The chemical formula for a substance shows how many atoms of each element are present in a molecule, or the proportion of atoms of each element. The formula can be worked out using the valency.
The chemical formula of a covalent molecular substance gives the number of atoms per molecule. The formula of a covalent network or ionic compound gives the simplest ratio of atoms/ions in the substance.
Sometimes the name of the compound gives information about the formula of that compound. Names of these compounds have prefixes that give the number of atoms of certain elements in each molecule.
Table showing prefixes that give the number of atoms of certain elements in each molecule
Prefix
Number of atoms
Mono-
One
Di-
Two
Tri-
Three
Tetra-
Four
Penta-
Five
Hexa-
Six
Prefix
Mono-
Number of atoms
One
Prefix
Di-
Number of atoms
Two
Prefix
Tri-
Number of atoms
Three
Prefix
Tetra-
Number of atoms
Four
Prefix
Penta-
Number of atoms
Five
Prefix
Hexa-
Number of atoms
Six
For example, carbon monoxide contains one carbon atom joined to one oxygen atom, so it has the formula CO.
The ending of the name can also give information on the number of elements in a compound.