Empirical formula calculator
Find the simplest whole-number formula from percentage composition or masses, and the molecular formula from a molar mass.
A clear answer. Here’s how.
Each amount is divided by the element’s atomic weight to give relative moles. Dividing all of them by the smallest gives the mole ratio. If a ratio is not whole, the smallest multiplier from 1 to 8 that brings every ratio within 0.05 of a whole number is applied, so 1 : 1.5 becomes 2 : 3. The empirical formula mass is the sum of the subscripts times the atomic weights. A molar mass divided by that mass should be a whole number n, and the molecular formula is the empirical formula with every subscript multiplied by n. Experimental error or the wrong atomic weights can mislead, so check the result makes chemical sense.
How this is checked
3 reference checks passed These 3 cases were run when this page was built, on 20 October 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.
See the checks and where each expected answer comes from
Case 1
- Inputs
- Elements and amounts, one per line (mass or percent) C 40.00 H 6.71 O 53.29Molar mass of the compound (g/mol), or 0 to skip 180.16
- Expected, and what Toolmoz gave
- Empirical formula expected CH2O, Toolmoz CH2OEmpirical formula mass (g/mol) expected 30.026, Toolmoz 30.026Molecular formula expected C6H12O6, Toolmoz C6H12O6Empirical formula units per molecule expected 6, Toolmoz 6
- Where the expected answer comes from
- Glucose: 40.00 ÷ 12.011 = 3.3303, 6.71 ÷ 1.008 = 6.6567, 53.29 ÷ 15.999 = 3.3308 mol, ratio 1 : 1.9989 : 1.0002 so CH2O of mass 12.011 + 2 × 1.008 + 15.999 = 30.026, and 180.16 ÷ 30.026 = 6.0001
- Allowed difference
- ±1e-9
Case 2
- Inputs
- Elements and amounts, one per line (mass or percent) Fe 69.94 O 30.06Molar mass of the compound (g/mol), or 0 to skip 0
- Expected, and what Toolmoz gave
- Empirical formula expected Fe2O3, Toolmoz Fe2O3Empirical formula mass (g/mol) expected 159.687, Toolmoz 159.687Multiplier applied to the mole ratios expected 2, Toolmoz 2
- Where the expected answer comes from
- Iron(III) oxide: 69.94 ÷ 55.845 = 1.2524 mol Fe and 30.06 ÷ 15.999 = 1.8789 mol O, ratio 1 : 1.5002, times 2 gives Fe2O3 of mass 2 × 55.845 + 3 × 15.999 = 159.687
- Allowed difference
- ±1e-9
Case 3
- Inputs
- Elements and amounts, one per line (mass or percent) N 30.45 O 69.55Molar mass of the compound (g/mol), or 0 to skip 92.01
- Expected, and what Toolmoz gave
- Empirical formula expected NO2, Toolmoz NO2Molecular formula expected N2O4, Toolmoz N2O4
- Where the expected answer comes from
- Nitrogen dioxide: 30.45 ÷ 14.007 = 2.1740 and 69.55 ÷ 15.999 = 4.3471 mol, ratio 1 : 2.0 gives NO2 of mass 46.005, and 92.01 ÷ 46.005 = 2 so N2O4
- Allowed difference
- exact
What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Elements and amounts, one per line (mass or percent)
C 40.00 H 6.71 O 53.29
- Molar mass of the compound (g/mol), or 0 to skip
- 180.16
Example result
| Element | Amount entered | Atomic weight (g/mol) | Moles (per unit amount) | Ratio to smallest | Subscript |
|---|---|---|---|---|---|
| C (Carbon) | 40 | 12.011 | 3.33028 | 1 | 1 |
| H (Hydrogen) | 6.71 | 1.008 | 6.65675 | 1.9989 | 2 |
| O (Oxygen) | 53.29 | 15.999 | 3.33083 | 1.0002 | 1 |
Empirical formula mass 30.026 g/mol; mole ratios were multiplied by 1 (largest distance from a whole number 0.0011). Each amount is divided by its atomic weight, then by the smallest result. A multiplier of 1 to 8 turns the ratios into whole numbers when they end in .5, .33, .25 and similar. Percentages need not add up to exactly 100. Experimental data with large error can give a wrong ratio, so check that the formula is chemically sensible.