Chemistry & Chemical Engineering Moles, Mass & Chemical Formulas IUPAC standard atomic weights (abridged, 2021)

Empirical Formula Calculator

Give this calculator the mass percentages or the raw masses of the elements in a compound and it returns the empirical formula — the simplest whole-number ratio of atoms. It divides each amount by the element's atomic weight to get moles, divides through by the smallest, and then scales the ratio to whole numbers, showing every step so you can reproduce it on paper. If you also know the molar mass from mass spectrometry or a colligative measurement, it multiplies up to the molecular formula.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Element amountsOne element per entry, symbol then amount, separated by commas: C 40.00, H 6.71, O 53.29.C 40.00, H 6.71, O 53.29
The amounts areThe arithmetic is identical either way; this only controls the sum check.Mass percent (%)
Measured molar mass (optional)From mass spectrometry or freezing-point depression; leave at 0 if you do not have it.180.16 g/mol

It returns

  • Empirical formula — The simplest whole-number ratio of atoms, in the order you entered the elements.
  • Empirical formula mass
  • Molecular formula
  • Molecular / empirical multiple — Measured molar mass divided by the empirical formula mass, rounded to a whole number.
  • Total of the amounts you entered

The formula

ni=miAr,i,ri=nimin(n)
x=MMemp

In plain text: nᵢ = mᵢ / Aᵣ,ᵢ → divide all nᵢ by the smallest → scale to whole numbers

  • mᵢMass or mass percent of element i (g or %)
  • Aᵣ,ᵢStandard atomic weight of element i (g/mol)
  • nᵢMoles of element i in the sample (mol)
  • rᵢMole ratio of element i to the least abundant element (ratio)
  • kSmallest whole number that makes every rᵢ integral (count)

Percentages can be used directly as masses because assuming a 100 g sample makes each percentage a mass in grams — that assumption changes nothing in the final ratio.

Updated Category Moles, Mass & Chemical Formulas Verified against published test cases Reading time 9 min

Empirical formula versus molecular formula

An empirical formula is the simplest whole-number ratio of atoms in a compound. A molecular formula is the actual count of atoms in one molecule. They are often different: glucose has the molecular formula C₆H₁₂O₆ but the empirical formula CH₂O, because 6:12:6 reduces to 1:2:1.

The distinction exists because of what each measurement can see. Elemental analysis measures mass fractions, and mass fractions only ever tell you a ratio — burning glucose and burning formaldehyde produce carbon dioxide and water in exactly the same proportion. To get from the ratio to the real molecule you need one extra piece of information: the molar mass, from mass spectrometry, from vapour density, or from a colligative property such as freezing-point depression.

Ionic compounds have no molecular formula at all. Sodium chloride is an extended lattice, so NaCl is an empirical formula and there is nothing to scale it up to. The same is true of most minerals and of network solids such as silicon dioxide.

The four steps, and why each one is there

Step one: assume 100 g. If your data are percentages, treat each percentage as a mass in grams. This is not an approximation — the ratio you are after is unchanged by the size of the sample, so choosing the most convenient sample size is free.

Step two: convert mass to moles. Divide each mass by that element's atomic weight. This is the only step that does real chemical work, because a formula is a ratio of atoms and a balance measures mass. Heavy elements are badly under-represented in mass terms: in water, oxygen is 88.8% of the mass but only a third of the atoms.

Step three: divide by the smallest. Dividing every mole figure by the smallest of them makes the least abundant element the unit of comparison, so the smallest ratio is exactly 1 and the others read directly as multiples of it.

Step four: scale to whole numbers. Ratios like 1 : 1.5 are real but cannot be subscripts, so you multiply everything by the smallest integer that clears the fractions — 2 in that case, giving 2 : 3. Recognise the common decimals: .5 needs ×2, .33 and .67 need ×3, .25 and .75 need ×4, .2 and .4 need ×5. This calculator searches multipliers up to 12 and takes the first that brings every ratio within 0.08 of a whole number.

Finally, reduce by any common factor. If the rounding produced 2 : 4 : 2, the empirical formula is the reduced 1 : 2 : 1 — that is what makes it empirical.

Worked example: a compound that is 40.00% C, 6.71% H and 53.29% O

This is the classic combustion-analysis result. Work it through.

  1. Assume 100 g: 40.00 g C, 6.71 g H, 53.29 g O.
  2. Moles of carbon: 40.00 ÷ 12.011 = 3.3303 mol.
  3. Moles of hydrogen: 6.71 ÷ 1.008 = 6.6567 mol.
  4. Moles of oxygen: 53.29 ÷ 15.999 = 3.3308 mol.
  5. Divide by the smallest (3.3303): C = 1.000, H = 1.999, O = 1.000.
  6. Round: the ratio is 1 : 2 : 1, so the empirical formula is CH₂O, with an empirical formula mass of 12.011 + 2(1.008) + 15.999 = 30.026 g/mol.
  7. Bring in the molar mass. Mass spectrometry gives 180.16 g/mol. Divide: 180.16 ÷ 30.026 = 6.000, so the molecular formula is 6 × CH₂O = C₆H₁₂O₆.

Note how little the last step costs and how much it buys. Without it, the composition is equally consistent with formaldehyde (CH₂O, 30.03 g/mol), acetic acid (C₂H₄O₂, 60.05) and glucose (C₆H₁₂O₆, 180.16). Confirm the molar mass with the molar mass calculator and check your answer by running it back through the percent composition calculator: C₆H₁₂O₆ returns 40.00% C, 6.71% H and 53.28% O, reproducing the data you started from to the precision the input carried.

How to judge whether the answer is trustworthy

Look at how far the ratios sit from whole numbers before rounding. A value of 1.99 rounding to 2 is comfortable. A value of 1.90 is not — that is a 5% discrepancy, larger than any competent elemental analysis, and it usually means an element is missing from your data or one figure was transcribed wrongly. As a working rule, treat anything more than about 0.08 away from an integer, after the multiplier has been applied, as a signal to re-check rather than to round harder.

Check that percentages sum to about 100. Combustion analysis measures carbon, hydrogen and nitrogen directly and reports oxygen by difference, so a set that sums to 94% usually means an unmeasured element — a halogen, a metal, or sulfur — that has been left out entirely. Adding the missing 6% to oxygen would be wrong; you need the actual assay.

Sanity-check the multiplier against the molar mass. If the measured mass divided by the empirical formula mass comes out as 3.4 rather than close to 3 or 4, the two measurements disagree and at least one is wrong. A ratio that lands within about 0.1 of an integer is the standard for accepting a molecular formula.

Finally, remember that an empirical formula is not a structure. C₂H₆O is both ethanol and dimethyl ether; the two have the same composition, the same molar mass, and boiling points 100 °C apart. Composition constrains structure but never determines it.

Empirical formulas of familiar compounds

Molecular formulas reduced to their simplest ratio, with the multiple between them.
CompoundMolecular formulaEmpirical formulaMultipleEmpirical mass (g/mol)
FormaldehydeCH₂OCH₂O130.026
Acetic acidC₂H₄O₂CH₂O230.026
GlucoseC₆H₁₂O₆CH₂O630.026
AcetyleneC₂H₂CH213.019
BenzeneC₆H₆CH613.019
EthaneC₂H₆CH₃215.035
Hydrogen peroxideH₂O₂HO217.007
WaterH₂OH₂O118.015
Sodium chloridenone (ionic lattice)NaCl58.440
Hematitenone (ionic lattice)Fe₂O₃159.687

The first three rows share a composition exactly, which is why a molar mass is required to choose between them.

Pitfalls that produce a wrong formula

  • Dividing percentages by each other instead of converting to moles. Mass ratios are not atom ratios. This is the single most common error and it always inflates the heavy element.
  • Rounding too early. Carry at least four significant figures through the mole step; rounding 3.3303 to 3.33 before dividing shifts the hydrogen ratio enough to matter.
  • Rounding 1.5 down to 1. A half means multiply everything by two. Rounding it away produces a formula that no compound has.
  • Forgetting an element determined by difference. If your percentages sum to well under 100, something was never measured. The gap does not automatically belong to oxygen.
  • Using the empirical formula mass where the molar mass is needed. In a yield calculation the molecular formula mass is the one that counts.
  • Assuming an empirical formula identifies the compound. It fixes composition, not structure and not molecular size.

Where the input data comes from

For organic compounds the numbers almost always come from combustion analysis. A few milligrams are burned in excess oxygen; all the carbon becomes carbon dioxide and all the hydrogen becomes water, and the masses of those two products are measured. Carbon mass is 12.011/44.009 of the carbon dioxide, and hydrogen mass is 2(1.008)/18.015 of the water. Nitrogen is measured in the same instrument by reducing nitrogen oxides to N₂. Oxygen is reported by difference, which is why oxygen carries the accumulated error of every other element.

For inorganic samples the route is usually a dissolution followed by an instrumental technique — ICP-OES or ICP-MS for metals, ion chromatography for anions — or a classical gravimetric precipitation. For hydrates, the water content is often found simply by heating to constant mass, and the mass lost divided by the molar mass of water gives the number of waters directly.

Once you have a formula, the rest of the quantitative chain follows: use the molar mass calculator to get g/mol, the moles-to-grams calculator to weigh a sample, and the theoretical yield calculator once the compound is a product rather than an unknown.

A historical note worth keeping: this procedure is essentially Justus von Liebig's, from the 1830s. His combustion train, with a potash bulb to trap carbon dioxide, made carbon and hydrogen determinations routine and turned organic chemistry into a quantitative science. The instrument is now automated and the sample is a thousand times smaller, but the arithmetic on this page has not changed.

Frequently asked questions

How do I find the empirical formula from percentages?

Treat each percentage as grams in a 100 g sample, divide each by the element's atomic weight to get moles, divide all the mole values by the smallest one, then multiply by the smallest whole number that clears any fractions. Reduce by a common factor if one remains. The calculator shows each of those four steps in the table so you can check them by hand.

What is the difference between empirical and molecular formula?

The empirical formula is the simplest atom ratio; the molecular formula is the true atom count in one molecule. They differ by a whole-number multiple. Glucose is C₆H₁₂O₆ molecularly and CH₂O empirically, a multiple of six. You can only find the multiple if you know the molar mass independently — composition data alone cannot supply it.

What do I do when a ratio comes out as 1.5?

Multiply every ratio by 2. Common fractions map to fixed multipliers: 0.5 to ×2, 0.33 or 0.67 to ×3, 0.25 or 0.75 to ×4, 0.2 or 0.4 to ×5. Never round a half to the nearest integer — a ratio of 1 : 1.5 is Fe₂O₃, and rounding it to 1 : 2 would give you FeO₂, which does not exist as a stable oxide.

My percentages do not add to 100. Does that matter?

Yes. A total between about 98.5 and 101.5 is normal experimental scatter and the ratio will still be reliable. A total well below that means an element was not measured — commonly a halogen, sulfur or a metal — and the ratio you get will be wrong for every element, not just the missing one. Get the full assay before proceeding.

Can I enter masses in grams instead of percentages?

Yes, and the arithmetic is identical because only the ratio matters. Set the basis selector to grams so the calculator does not warn you about not summing to 100. This is the natural way to work from a combustion analysis, where you have the actual mass of carbon dioxide and water rather than a percentage report.

Why does the calculator need the molar mass?

Only to scale up to the molecular formula. Leave the field at zero and you still get a valid empirical formula and its formula mass. Enter a measured molar mass and the calculator divides it by the empirical formula mass and rounds to the nearest whole number, which is the multiple. If that division is not close to an integer, one of the two measurements is faulty.

Does this work for hydrates?

It works if you enter hydrogen and oxygen as elements, but the answer will fold the water into the ratio rather than showing it as a separate unit. For a hydrate the usual approach is different: heat the sample to constant mass, divide the mass lost by 18.015 to get moles of water, divide the residue mass by the molar mass of the anhydrous salt, and take the ratio of those two numbers.

Does the empirical formula tell me what the compound is?

No. It constrains composition only. C₂H₆O is both ethanol and dimethyl ether, and CH₂O is shared by formaldehyde, acetic acid, lactic acid and glucose. You need a molar mass to fix the molecular formula, and spectroscopy — infrared, NMR, or a crystal structure — to fix the arrangement of the atoms.

References