Empirical formula is the simplest whole number ratio of atoms present in a compound. The empirical formula of a compound is determined by knowing the percentage composition of a compound. Molecular formula shows the actual number of atoms of each element present in a molecule of that compound.
Molecular formula = (Empirical formula) x n
where n is 1,2,3 and so on