A molecular formula expresses in positive whole numbers the total count of each atom in a molecule.
For example, in the molecular formula of H2O, the total count of Hydrogen atoms is 2, and that of Oxygen atoms is 1. Another example of a complex molecule, such as glucose, expressed in a molecular formula as C6H12O6, has a total of 6 carbon and oxygen atoms, and 12 hydrogen atoms.
A molecular formula is always a multiple of the empirical formula, and their relationship is expressed as,
Molecular Formula (M.F.) = n x Empirical Formula (E.F.), where n is a positive whole number.

For example, the molecular formula for benzene is C6H6; the empirical formula is CH.
Mathematically,
M.F. = 6 x CH
Similarly, applying the concept to the examples above,
M.F. (glucose, C6H12O6) = 6 x CH2O
M.F. (water, H2O) = 1 x H2O

A molecular formula, however, does not reveal a compound’s structure and bonding patterns, including the functional groups present.
- Calculate the molecular formula of a compound from analytical data and molecular mass - Example of Glucose (numerical problem)
- Empirical and Molecular Formula Writing Rules – Hill Nomenclature