The molecular formula is the chemical formula that gives the number of each element in a compound, while the empirical formula is the simplest whole number ratio of atoms present in a compound
Molecule of glucose :
Molecular formula = C6H12O6
Empirical formula = CH2O