The chemical formula of a compound represents the ratio of atoms of each element present in it. The ratio of masses is determined by multiplying the number of atoms of each element by its atomic mass.