How to determine the formula of an unknown compound ?

The chemical formula of a compound can be determined from the composition of the compound. The composition of a compound is commonly expressed in terms of percentage of each element present in it.