How to write chemical formula

Compounds are formed by the chemical bonding of atoms or ions of elements. The formula is built in such a way that the combining powers are balanced.

While formulating a compound formula, its combining powers or valency should be known.

What is Valency?

Valence electrons are electrons found in the outermost energy level of an element’s atom. Some elements have many valencies. The number of valence electrons in an element’s atom is usually equal to its highest valency.

The valency of an element is equal to the number of electrons lost or acquired by an atom of that element during chemical combination, or the number of pairs of electrons exchanged between the atoms.

Valencies of several elements in a table

Element Valency
Hydrogen 1
Helium 0
Lithium 1
Beryllium 2
Boron 3
Carbon 4
Nitrogen 3, 5
Oxygen 2
Fluorine 1
Neon 0
Sodium 1
Magnesium 2
Aluminum 3
Silicon 4
Phosphorus 3, 5
Sulfur 2, 4, 6
Chlorine 1
Argon 0
Potassium 1
Calcium 2

Number of atoms in a compound’s formula

A number at the bottom of an element’s symbol in a chemical formula denotes the number of atoms of that element contained in a molecule of the compound.

Number of atoms in the glucose formulae

C6 H12O6 is the chemical formula for glucose. This means that a glucose molecule is made up of six carbon atoms, twelve hydrogen atoms, and six oxygen atoms.

Writing Formulae Using Valency

As a compound’s chemical formula is written, the atoms are connected such that their combining abilities become equal. This is accomplished by shifting the valencies of the two elements and writing them at the bottom end of the respective symbols on the right hand side.

Writing Formulae water

The chemical formula for water is H2O. It consists of two hydrogen atoms (H) and one oxygen atom (O) held together by covalent bonds.

Writing Formulae water in a diagram

How to write formulae for ammonia

The chemical formula for ammonia is NH3. It consists of one nitrogen atom (N) and three hydrogen atoms (H). The nitrogen and hydrogen atoms are held together by covalent bonds, which means they share electrons to form a stable molecule.

Simple way of writing formulae

Chemical formulae are a method of describing a substance’s chemical makeup by using chemical symbols and subscripts to denote the number of atoms of each element in a molecule or compound. The formula represents the material in a clear and brief manner that can be used to convey its chemical properties and behavior.

To write a formula for a compound, you need to identify the elements that make up the compound and their respective numbers. The elements are represented by their chemical symbols, such as H for hydrogen, O for oxygen, and C for carbon, among others. The number of atoms of each element is indicated by a subscript written to the right of the element symbol. For example, H2O indicates that there are two hydrogen atoms and one oxygen atom in a water molecule.

Some basic rules to follow when writing chemical formulas are:

  • The formula should have the lowest whole number ratios of atoms.
  • The number of atoms of each element in the compound should be indicated by subscripts, not by a separate number next to the element symbol.
  • If there is only one atom of an element, the subscript 1 is usually omitted.

Simple way of writing formulae for calcium oxide

How to write sodium oxide formulae

Writing formulae for sodium chloride

Calcium chloride formulae

Magnesium nitride formulae

When a compound has a poly atomic ions or radicals

What are poly atomic ions?

A polyatomic ion is an ordered arranged group of atoms of elements with a charge.

Examples for Polyatomic Ions (Radicals)


C2H3O2 (charge: -1)


NH4+ (charge: +1)

Bicarbonate (or hydrogen carbonate):

HCO3 (charge: -1)


CO32- (charge: -2)


ClO3 (charge: -1)


ClO2 (charge: -1)


CrO42- (charge: -2)


CN (charge: -1)


Cr2O72- (charge: -2)


OH (charge: -1)


NO3 (charge: -1)


NO2 (charge: -1)


C2O42- (charge: -2)


O22- (charge: -2)


MnO4 (charge: -1)


PO43- (charge: -3)


SO42- (charge: -2)


SO32- (charge: -2)


S2O32- (charge: -2)

Valency of several Polyatomic Ions (Radicals) in a table

Polyatomic Ion Valency
Acetate -1
Ammonium +1
Bicarbonate (Hydrogen Carbonate) -1
Carbonate -2
Chlorate -1
Chlorite -1
Chromate -2
Cyanide -1
Dichromate -2
Hydroxide -1
Nitrate -1
Nitrite -1
Oxalate -2
Peroxide -2
Permanganate -1
Phosphate -3
Sulfate -2
Sulfite -2
Thiosulfate -2

Writing formulae for compounds with polyatomic ions

Writing formulae for Magnesium nitrate in a diagram

How to write sodium nitrate formulae

Potassium carbonate formulae writing in a diagram

Ammonium phosphate formulae in a diagram

Formulae of the ionic compounds

In some cases, the chemical formula does not reflect a molecule. Table salt, also known as sodium chloride, is an example of such a chemical. There are no distinct molecules in solid sodium chloride.

It is an ionic lattice made up of Na+ and Cl ions organized alternately. Because Na+ and Cl ions are present in the lattice in a 1:1 ratio, the formula is represented as NaCl.

Share this post
About Author

Anuradhika Lakmali

Anuradhika Lakmali is a co-founder of Science A Plus learning network. She is working as a government teacher and has interest in chemistry, biology, phisics and self development.