CalcSeed

Empirical Formula Calculator

Enter the mass and molar mass of two elements to find their simplest whole-number mole ratio.

=
Quick answer: with the default inputs (12 g, 12 g/mol, 4 g, 1 g/mol), the subscript of a is 1. At these inputs: subscript of B = 4. Change any input to update the result.
Subscript of A
—

What this calculator returns

It returns the two subscripts of the simplest whole-number formula, AxBy. At the defaults — 12 g of an element with molar mass 12 g/mol and 4 g of one with molar mass 1 g/mol — it reports 1 and 4, giving CH4. Masses are in grams and molar masses in g/mol.

n=mMn = rac{m}{M}

Three steps from masses to subscripts

Divide each mass by its own molar mass to get moles. For the defaults, 12 g ÷ 12 g/mol = 1.00 mol of A and 4 g ÷ 1 g/mol = 4.00 mol of B. Those are the actual amounts present in the sample, not yet the formula.

Divide both mole values by the smaller one. Here the smaller is 1.00, so A becomes 1.00 and B becomes 4.00. Rounding to integers gives the subscripts 1 and 4, which is why the answer is CH4.

If the reduced values are not close to whole numbers, multiply both by the smallest integer that clears the fraction. A ratio of 1 : 1.5 becomes 2 : 3, and 1 : 1.33 becomes 3 : 4. The calculator runs this search automatically up to a factor of 12.

Worked example at the defaults

A 16 g sample contains 12 g of carbon and 4 g of hydrogen, which is the composition of methane by mass. Carbon contributes 12 ÷ 12.01 = 0.999 mol and hydrogen 4 ÷ 1.008 = 3.968 mol, a ratio of roughly 1 : 3.97, which rounds cleanly to 1 : 4.

Writing the formula as CH4 and checking the mass closes the loop: 12.01 + 4 × 1.008 = 16.04 g/mol, matching the 16 g sample. Any formula you derive should reproduce the input masses this way; if it does not, the moles were divided the wrong way round.

Common compositions worked through

SampleMoles of AMoles of BRatioFormula
12 g C (12) + 4 g H (1)1.004.001 : 4CH4
2 g H (1) + 16 g O (16)2.001.002 : 1H2O
23 g Na (23) + 35.5 g Cl (35.5)1.001.001 : 1NaCl
56 g Fe (56) + 24 g O (16)1.001.502 : 3Fe2O3
14 g N (14) + 32 g O (16)1.002.001 : 2NO2

The fractional ratio trap

Iron oxide is the case that catches people. 56 g of iron is 1 mol and 24 g of oxygen is 1.5 mol, so the raw ratio is 1 : 1.5. Rounding 1.5 to 2 gives FeO2, which is wrong on both counts. Doubling to 2 : 3 gives Fe2O3, the correct formula, and the mass check confirms it at 159.7 g/mol.

Getting from empirical to molecular formula

The empirical formula is the reduced ratio; the molecular formula is the real atom count. Divide the compound’s measured molar mass by the empirical formula mass. Glucose has empirical CH2O at 30.03 g/mol and a measured molar mass of 180.16, so the multiplier is 180.16 ÷ 30.03 = 6 and the molecular formula is C6H12O6.

Without a molar mass you cannot take that last step, which is why combustion analysis reports empirical formulas only. Methane happens to have identical empirical and molecular formulas because its multiplier is 1, but that is the exception rather than the rule.

  • CH2O at 30.03 g/mol against a measured 180.16 g/mol gives a multiplier of 6.
  • A multiplier close to 1 means the empirical and molecular formulas are the same.
  • A multiplier that lands between integers means the molar mass measurement needs repeating.

Where the method gives a bad answer

  • Hydrated salts: water of crystallisation is not part of the anhydrous ratio, so dry the sample or account for it separately.
  • Impure samples: a 5% impurity shifts every mass and can move a 1 : 1.99 ratio to 1 : 2.08, which still rounds correctly, but larger contamination does not.
  • Weighing error: at 0.1 g precision on a 4 g mass you carry a 2.5% uncertainty, enough to blur a 1 : 1.33 ratio.
  • Diatomic elements: oxygen gas is O2, so 32 g of O2 is 1 mol of O2 but 2 mol of O atoms.

Mistakes that flip the answer

Dividing the molar mass by the mass instead of the other way round is the most common slip. It inverts every mole value, so 12 g of carbon becomes 1 rather than 1 mol only by luck; on the default hydrogen it turns 4 mol into 0.25 and the ratio becomes 4 : 1 instead of 1 : 4.

Using the atomic number instead of the molar mass is the second. Carbon’s atomic number is 6, so 12 g ÷ 6 gives 2 mol and the formula drifts to C2H4. Always take the molar mass from the periodic table, 12.01 for carbon and 1.008 for hydrogen.

Starting from percent composition

Lab reports often give percentages rather than grams. Treat the percentages as grams in a 100 g sample: 40.0% C, 6.7% H and 53.3% O become 3.33 mol, 6.7 mol and 3.33 mol, which reduces to 1 : 2 : 1 and gives CH2O. Run the two-element calculator twice if you need to pair the elements up.

Frequently asked questions

How do you find an empirical formula?

Convert each mass to moles, divide by the smallest mole value, then scale to whole numbers. At the defaults, 12 g ÷ 12 = 1 mol and 4 g ÷ 1 = 4 mol, giving 1 : 4 and CH4.

What is the difference between empirical and molecular formula?

Empirical is the reduced ratio, molecular is the actual count. Glucose is CH2O empirically and C6H12O6 molecularly, a multiplier of 6.

What if the ratio comes out as 1.5 to 1?

Multiply both subscripts by 2 to get 3 : 2. Iron oxide with 1 mol Fe and 1.5 mol O becomes Fe2O3, not FeO2.

Why does the calculator return 1 and 4 for 12 g and 4 g?

Because 12 g ÷ 12 g/mol = 1 mol and 4 g ÷ 1 g/mol = 4 mol. Dividing by the smaller value leaves 1.00 and 4.00, which are already integers.

Can the empirical formula be the same as the molecular formula?

Yes, when the multiplier is 1. Methane is CH4 both ways, and water is H2O both ways, because their molar masses equal the empirical formula mass.

What do I do with a percentage composition?

Treat each percentage as grams in a 100 g sample. 40% carbon becomes 40 g, which is 40 ÷ 12 = 3.33 mol, and the rest follows the same three steps.

How precise does the rounding need to be?

The calculator accepts values within 0.02 of an integer. A ratio of 1 : 2.98 counts as 1 : 3, while 1 : 2.5 does not round and is doubled to 2 : 5 instead.

What if there are three elements?

The same logic extends, but this tool handles two. Run it on one pair, then on another, and combine the ratios through the shared element to reach something like CH2O.

Why is my formula double what I expect?

You probably skipped the reduction step. A sample with 2 mol A and 8 mol B has ratio 2 : 8, which reduces to 1 : 4, not C2H8.

Method and sources

Calculation basis

Physical constants follow CODATA 2022 recommended values, and formulas follow standard physics definitions.

Last updated: November 18, 2026
Formula & data sources
  • Empirical formula from moles = mass / molar mass and reduction to the smallest whole-number ratio.

Cite this page

Reference formats
APA 7CalcSeed. (2026, November 18). Empirical Formula Calculator. https://calcseed.com/c/scientific/empirical-formula-calculator/
MLA 9"Empirical Formula Calculator." CalcSeed, 18 Nov. 2026, calcseed.com/c/scientific/empirical-formula-calculator/.
ChicagoCalcSeed. "Empirical Formula Calculator." Last modified November 18, 2026. https://calcseed.com/c/scientific/empirical-formula-calculator/

Related calculators