The empirical formula obtained from elemental analysis identifies the ratio of components, not their actual number. The empirical formula of a compound is the simplest possible formula indicating the relative numbers of different atoms in it. The empirical formula shows the simplest ratio of an element in a compound and uses the smallest possible set of subscript numbers.

The general formula for empirical formula is given below.

Empirical formula = $\frac{Molecular\ formula}{n}$

n = $\frac{Empirical\ formula}{Molecular\ formula}$

Where, n is a whole number from 1 to as large as necessary.

The step by step calculation of empirical formula is given below.
  1. Convert the percent numbers to grams for each element.
  2. Convert the mass of each element to moles of that element.
  3. The number of moles for each element become their subscript in the empirical formula.
  4. Convert the subscript numbers to whole numbers.

Some of the solved problems based on empirical formula is given below:

Question 1: A 1.500g sample of a compound contains 0.467g sulfur and 1.033g chlorine. What is the empirical formula of the compound?
Solution:
Determining the number of moles of each element.

mole S = 0.467g S $\times$ $\frac{1\ mole\ S}{32.07g\ S}$

mole S = 0.0146 mole S

mole Cl = 1.033g Cl $\times$ $\frac{1\ mole\ Cl}{35.45g\ Cl}$

mole Cl = 0.0291 mole Cl

The empirical formula is $S_{0.0146 \ mole} \ Cl_{0.0291 \ mole} = S_{1}Cl_{2} = SCl_{2}$.

Question 2: 
The empirical formula of a compound is PNCl2, and its molecular mass is 347.6 amu. What is the molecular formula of the compound?
Solution:
First calculate the mass of the empirical formula PNCl2.

P + N + 2Cl = 30.97amu + 14.01amu + 2(35.45amu) = 115.9amu

Dividing the molecular mass of the compound by the empirical formula mass shown that the formula of the molecule is three times the empirical formula.

n = $\frac{molecular\ mass}{empirical\ formula\ mass}$

n = $\frac{347.6\ amu}{115.9\ amu}$

n = 2.99 = 3

The molecular formula is $3(PNCl_{2}) = P_{3}N_{3}Cl_{6}$.