Composition to atomic ratio

Empirical Formula Calculator

An empirical formula is the simplest whole-number ratio of atoms in a compound. Enter the mass or mass percentage of each element. The calculator converts each amount to moles, divides by the smallest value, and scales fractions such as 1.5 or 1.33 to whole numbers. Add the molar mass to get the molecular formula as well.

Browser-side calculationStep-by-step resultEducational use

Empirical Formula Calculator

Calculator

Choose percent composition or measured masses, then enter two to eight elements. Element symbols and English names are accepted. The molar mass is optional.

Inputs
Enter one row per element, using a symbol such as Fe or a name such as iron. Add a molar mass to get the molecular formula too.

Each percentage is treated as grams in a 100 g sample.

Element composition

3 of 8 rows

Enter the compound's molar mass, for example from mass spectrometry, to get the molecular formula.

Load an example

Result
Mole conversions keep full precision. Only the displayed table values are rounded.
Enter each element with its mass or percentage, then select Calculate. The result shows the empirical formula, the mole ratio table, and each step. Add a molar mass to get the molecular formula.
moles = mass ÷ atomic weight | ratio = moles ÷ smallest moles | n = molar mass ÷ empirical formula mass

Calculation method

How the calculation works

Step 1
Convert each element to moles
Divide each mass by the element’s standard atomic weight (CIAAW 2024 abridged values). For percentages, assume a 100 g sample so 40.0% becomes 40.0 g.
Step 2
Divide by the smallest mole value
This gives the mole ratio, with the least abundant element equal to 1. Ratios within ±0.05 of a whole number are rounded.
Step 3
Clear fractions, then scale to the molar mass
A ratio near x.5 is multiplied by 2, x.33 or x.67 by 3, and x.25 or x.75 by 4, up to 12. With a molar mass, n = molar mass ÷ empirical formula mass, and every subscript is multiplied by n.

Worked examples

Check the result by hand

Empirical formula from percent composition
A compound is 40.0% C, 6.71% H, and 53.28% O by mass.
  1. 1.In a 100 g sample there are 40.0 g C, 6.71 g H, and 53.28 g O.
  2. 2.Moles: C = 40.0 / 12.011 = 3.330, H = 6.71 / 1.008 = 6.657, O = 53.28 / 15.999 = 3.330.
  3. 3.Divide by 3.330: C : H : O = 1.000 : 1.999 : 1.000, which rounds to 1 : 2 : 1.
The empirical formula is CH₂O.
A 1.5 ratio: multiply by 2
An iron oxide sample contains 34.97 g Fe and 15.03 g O.
  1. 1.Moles: Fe = 34.97 / 55.845 = 0.6262 and O = 15.03 / 15.999 = 0.9394.
  2. 2.Divide by 0.6262: Fe : O = 1 : 1.500.
  3. 3.Multiply both by 2 to clear the half: 2 : 3.000.
The empirical formula is Fe₂O₃.
A 2.25 ratio: multiply by 4
Aspirin is 60.00% C, 4.476% H, and 35.52% O by mass.
  1. 1.Moles in 100 g: C = 4.995, H = 4.440, O = 2.220.
  2. 2.Divide by 2.220: C : H : O = 2.250 : 2.000 : 1.
  3. 3.Multiply every ratio by 4 to clear the quarter: 9 : 8 : 4.
The empirical formula is C₉H₈O₄.
Molecular formula from molar mass
Nicotine is 74.02% C, 8.710% H, and 17.27% N, with a molar mass of 162.3 g/mol.
  1. 1.Moles in 100 g: C = 6.163, H = 8.641, N = 1.233. Dividing by 1.233 gives 4.998 : 7.008 : 1, so the empirical formula is C₅H₇N.
  2. 2.Empirical formula mass = 5(12.011) + 7(1.008) + 14.007 = 81.118 g/mol.
  3. 3.n = 162.3 / 81.118 = 2.001, which rounds to 2. Multiply every subscript by 2.
The molecular formula is C₁₀H₁₄N₂.

Scope

Assumptions and limits

These limits keep the result reproducible and make unsupported inputs visible instead of guessing.

Enter two to eight elements with positive masses or percentages.
Percentages that total more than one percentage point away from 100% still give a result, with a warning. An element found by difference, often oxygen, must be entered as its own row.
Ratios must round to whole numbers within ±0.05, with a closer fit required above a multiplier of 6. Experimental data that rounds only within ±0.1 is accepted with a warning. Ratios that need a multiplier above 12 are not resolved.
A molecular formula is given only when the molar mass is within 0.1 of a whole-number multiple of the empirical formula mass.
Elements appear in the order you enter them, and the Hill-order formula is shown when it differs. The formula does not show structure, charges, or water of hydration.
Elements without a CIAAW standard atomic weight, such as technetium, cannot be used because their moles cannot be calculated reproducibly.

Empirical Formula Calculator FAQ

Frequently asked questions

How do you find an empirical formula?

Convert the mass of each element to moles by dividing by its atomic weight. If you have percentages, assume 100 g so each percentage becomes grams. Divide every mole value by the smallest one, then round to whole numbers, multiplying first if a ratio ends near .5, .33, or .25. The whole numbers are the subscripts.

What is the difference between an empirical and a molecular formula?

The empirical formula is the simplest whole-number ratio of atoms. The molecular formula gives the actual number of atoms in one molecule and is a whole-number multiple of the empirical formula. Glucose has the empirical formula CH₂O and the molecular formula C₆H₁₂O₆.

How do you find the molecular formula from the empirical formula?

Divide the molar mass of the compound by the empirical formula mass to get n, then multiply every subscript by n. For CH₂O (30.026 g/mol) and a molar mass of 180.16 g/mol, n = 6, so the molecular formula is C₆H₁₂O₆.

When should I multiply the mole ratios, and by what number?

Multiply when a ratio is clearly between whole numbers. Use 2 for ratios ending near .5, 3 for .33 or .67, 4 for .25 or .75, and 5 for .2, .4, .6, or .8. Multiply every ratio by the same number. A value such as 1.98 or 2.03 is usually rounding error and can simply be rounded.

Do mass percentages have to total exactly 100%?

No. Rounded experimental values often total slightly more or less, and only the relative amounts matter. If one element was found by difference, subtract the others from 100% and enter that value as its own row. The calculator warns when the total is more than one percentage point from 100%.

How do I use combustion analysis data?

First convert the products back to element masses. Mass of C = mass of CO₂ × 12.011 / 44.009, and mass of H = mass of H₂O × 2.016 / 18.015. If the compound also contains oxygen, its mass is the sample mass minus the C and H masses. Then enter the three masses in mass mode.

Why is the formula written in a different order than I expected?

The formula lists elements in the order you enter them, so Na, S, O gives Na₂SO₄. When that order differs from Hill order (carbon, then hydrogen, then the other elements alphabetically), the Hill-order version is shown as well.