Calculates on this device. File exports run online.
Chemical Formula Calculator
Find the empirical formula of a compound from the percent of each element (or the masses), with each step of the working; turn it into the molecular formula with the molar mass; find the percent of each element in a formula; or work out a formula from a combustion analysis.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to find an empirical formula
- Choose Empirical formula from percentages or masses.
- Type each element with its percent by mass (or its mass in grams): C 40.0, H 6.7, O 53.3. You can paste them, one per line.
- Optional: type the molar mass of the compound to get the molecular formula.
- The working shows the moles of each element, the ratio to the smallest and the multiplier that makes whole numbers.
The method
- Moles of each element = mass (or percent, for 100 g) ÷ its standard atomic weight.
- Divide every number of moles by the smallest. If a ratio is near 1.5, 1.33 or 1.25, multiply all of them by 2, 3 or 4: the smallest whole multiplier (1 to 12) that brings every ratio within 0.1 of a whole number.
- Molecular formula = the empirical formula × n, where n = molar mass ÷ empirical formula mass, rounded to a whole number.
- Combustion analysis: all the carbon ends up in CO₂ and all the hydrogen in H₂O; oxygen is the rest of the sample mass.
Worked example
40.0 % C, 6.7 % H and 53.3 % O give 3.330 mol C, 6.647 mol H and 3.331 mol O in 100 g: ratios 1 : 2.00 : 1.00, the empirical formula CH2O (30.03 g/mol). With a molar mass of 180.16 g/mol, n = 6 and the molecular formula is C6H12O6. 10.00 mg of a sample that burns to 14.67 mg CO₂ and 6.00 mg H₂O is 40.04 % C and 6.71 % H, also CH2O. Magnesium nitrate, Mg(NO3)2, is 16.39 % Mg, 18.89 % N and 64.72 % O.
Where the data comes from
- Standard atomic weights: CIAAW, Standard Atomic Weights 2024, ciaaw.org; for elements with an interval the middle of the interval is used.
Limits you should know
- Lab data has errors: if no multiplier up to 12 fits, check the numbers or allow a larger closeness (advanced).
- The calculator does not draw structures and does not find formulas from a mass spectrum.