The symbolic representation of the composition of a chemical compound is known as the chemical formula.
It represents different elements present in a molecule of a compound and the number of atoms of the element bonded in the compound.
For example, the chemical formula of water is H2O. It contains the elements hydrogen (H) and oxygen (O). It also represents that it contains 2 atoms of hydrogen and one atom of oxygen.
The chemical formula is written on the basis of the valency of elements involved in the molecule of the compound.