acalculator

What is the empirical formula?

Pick each element in the compound and type its mass percent or its mass in grams. The empirical formula calculator turns them into moles, finds the simplest whole-number ratio, and gives the molecular formula if you add the molar mass.

Your numbers

Amounts are
Elements
Row 1
Row 2
Row 3
Empirical formula
CH₂O

The empirical formula is CH₂O.

Empirical formula mass (g/mol)
30.026
Mole ratios
C 1 : H 1.999 : O 1
Ratios multiplied by
1

Empirical formula: CH₂O. The empirical formula is CH₂O.

How to calculate

Finds the empirical formula of a compound from the mass or mass percent of each element, with the mole ratios, and the molecular formula when you know the molar mass.

Example with the default inputs (Amounts are Mass percent (%), Elements [Element C (carbon), Amount 40; Element H (hydrogen), Amount 6.71; Element O (oxygen), Amount 53.29]): The empirical formula is CH₂O.

Method: moles = grams (or percent) ÷ atomic weight; ratio = moles ÷ smallest moles; multiply by the smallest k from 1 to 10 that brings every ratio within 0.1 of a whole number and round; n = round(molar mass ÷ empirical formula mass).

  • Atomic weights are the CIAAW abridged standard atomic weights (2024); elements with no standard atomic weight are not offered.
  • A mass percent is read as the grams in a 100 g sample, so percents need not add up to exactly 100.
  • A ratio counts as whole when it is within 0.1 of a whole number after multiplying; measurement error larger than that can give a different formula.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Amounts are Mass (g), Elements Fe (iron) 34.97; O (oxygen) 15.03 gives Empirical formula Fe₂O₃, Ratios multiplied by 2, Empirical formula mass (g/mol) 159.687, Mole ratios Fe 1 : O 1.5.Source: OpenStax, Chemistry 2e, §3.2 Determining Empirical and Molecular Formulas (Example 3.11: 34.97 g Fe and 15.03 g O give Fe₂O₃; Example 3.12: 27.29% C and 72.71% O give CO₂; Example 3.13: nicotine, 74.02% C, 8.710% H, 17.27% N, 162.3 g/mol, gives C₅H₇N and C₁₀H₁₄N₂). https://openstax.org/books/chemistry-2e/pages/3-2-determining-empirical-and-molecular-formulas; CIAAW, Abridged Standard Atomic Weights (C 12.011, H 1.0080, N 14.007, O 15.999, Fe 55.845). https://ciaaw.org/abridged-atomic-weights.htm
  2. Amounts are Mass percent (%), Elements C (carbon) 27.29; O (oxygen) 72.71 gives Empirical formula CO₂, Ratios multiplied by 1, Empirical formula mass (g/mol) 44.009.Source: OpenStax, Chemistry 2e, §3.2 Determining Empirical and Molecular Formulas (Example 3.11: 34.97 g Fe and 15.03 g O give Fe₂O₃; Example 3.12: 27.29% C and 72.71% O give CO₂; Example 3.13: nicotine, 74.02% C, 8.710% H, 17.27% N, 162.3 g/mol, gives C₅H₇N and C₁₀H₁₄N₂). https://openstax.org/books/chemistry-2e/pages/3-2-determining-empirical-and-molecular-formulas; CIAAW, Abridged Standard Atomic Weights (C 12.011, H 1.0080, N 14.007, O 15.999, Fe 55.845). https://ciaaw.org/abridged-atomic-weights.htm
  3. Amounts are Mass percent (%), Elements C (carbon) 74.02; H (hydrogen) 8.71; N (nitrogen) 17.27, Molar mass (g/mol) 162.3 gives Empirical formula C₅H₇N, Molecular formula C₁₀H₁₄N₂, Formula units per molecule (n) 2, Empirical formula mass (g/mol) 81.118.Source: OpenStax, Chemistry 2e, §3.2 Determining Empirical and Molecular Formulas (Example 3.11: 34.97 g Fe and 15.03 g O give Fe₂O₃; Example 3.12: 27.29% C and 72.71% O give CO₂; Example 3.13: nicotine, 74.02% C, 8.710% H, 17.27% N, 162.3 g/mol, gives C₅H₇N and C₁₀H₁₄N₂). https://openstax.org/books/chemistry-2e/pages/3-2-determining-empirical-and-molecular-formulas; CIAAW, Abridged Standard Atomic Weights (C 12.011, H 1.0080, N 14.007, O 15.999, Fe 55.845). https://ciaaw.org/abridged-atomic-weights.htm
  4. Amounts are Mass percent (%), Elements C (carbon) 40; H (hydrogen) 6.71; O (oxygen) 53.29, Molar mass (g/mol) 180.16 gives Empirical formula CH₂O, Molecular formula C₆H₁₂O₆, Formula units per molecule (n) 6, Empirical formula mass (g/mol) 30.026.Source: CIAAW, Abridged Standard Atomic Weights (C 12.011, H 1.0080, N 14.007, O 15.999, Fe 55.845). https://ciaaw.org/abridged-atomic-weights.htm

How it works

For each element i with amount aᵢ (grams, or mass percent read as grams in 100 g) and atomic weight Wᵢ:

  1. Moles: mᵢ = aᵢ ÷ Wᵢ.
  2. Ratios: rᵢ = mᵢ ÷ (the smallest mᵢ).
  3. Multiplier: the smallest whole number k from 1 to 10 such that every rᵢ × k is within 0.1 of a whole number (|rᵢk − round(rᵢk)| ≤ 0.1).
  4. Subscripts: round(rᵢ × k). These give the empirical formula.
  5. Empirical formula mass: Σ subscript × Wᵢ, summed exactly on the printed weights.
  6. With a molar mass M: n = round(M ÷ empirical formula mass), and the molecular formula has every subscript times n.

Atomic weights are the CIAAW abridged standard atomic weights (2024), as printed: H 1.0080, C 12.011, N 14.007, O 15.999, Fe 55.845, and so on for the 84 elements that have one.

Rules

  • 1 to 10 elements; each amount more than 0 and at most 10⁹. Each element may appear only once; a repeat has no answer.
  • If no k from 1 to 10 works, there is no answer.
  • With a molar mass, n must be at least 1 and M ÷ formula mass within 0.1 of n; otherwise there is no answer.
  • Grams and percents give the same formula; the choice only names the amounts.

Output format. Formulas are in Hill order (carbon first, then hydrogen, then other symbols A to Z; with no carbon, all A to Z), with subscript digits (₂) and 1 left out. Mole ratios are in the same order, written C 1 : H 1.999 : O 1, each to 4 significant digits. The formula mass shows 3 decimals.

Worked examples by hand

34.97 g Fe and 15.03 g O. Fe 34.97 ÷ 55.845 = 0.62620 mol; O 15.03 ÷ 15.999 = 0.93943 mol. Ratios 1 : 1.5002. × 2 = 2 : 3.0004, so Fe₂O₃ (k = 2), mass 2 × 55.845 + 3 × 15.999 = 159.687 g/mol.

27.29% C and 72.71% O. C 2.2721 mol, O 4.5447 mol. Ratios 1 : 2.0002, so CO₂, mass 44.009 g/mol.

Nicotine: 74.02% C, 8.710% H, 17.27% N, 162.3 g/mol. C 6.1627, H 8.6409, N 1.2330 mol. Divided by 1.2330: 4.998 : 7.008 : 1, so C₅H₇N, mass 5 × 12.011 + 7 × 1.0080 + 14.007 = 81.118. 162.3 ÷ 81.118 = 2.0008, so n = 2 and the molecular formula is C₁₀H₁₄N₂.

40% C, 6.71% H, 53.29% O, 180.16 g/mol. C 3.3303, H 6.6567, O 3.3308 mol; ratios 1 : 1.999 : 1.000, so CH₂O (30.026 g/mol). 180.16 ÷ 30.026 = 6.0001, so C₆H₁₂O₆.

Other questions people ask

How do I find an empirical formula?

Turn each mass into moles by dividing by the atomic weight, divide every mole number by the smallest, and if a ratio is not close to whole, multiply them all by a small whole number. 34.97 g Fe and 15.03 g O give 0.6262 and 0.9394 mol, a ratio of 1 : 1.5, and times 2 that is Fe₂O₃.

How do I use percentages?

Read each percent as grams in a 100 g sample. 27.29% C and 72.71% O are 27.29 g and 72.71 g, which give 2.272 mol C and 4.545 mol O, a ratio of 1 : 2, so CO₂.

How do I get the molecular formula?

Divide the molar mass by the empirical formula mass and round to a whole number n, then multiply every subscript by n. Nicotine’s empirical formula C₅H₇N weighs 81.118 g/mol; 162.3 ÷ 81.118 = 2, so the molecular formula is C₁₀H₁₄N₂.

What if a ratio is 1.33 or 1.25?

Multiply by 3 or 4. 1.33 × 3 ≈ 4 and 1.25 × 4 = 5. The page tries 1, 2, 3 and so on up to 10 and uses the first that brings every ratio within 0.1 of a whole number.

Do my percentages have to add up to 100?

No. Only the ratios between the elements matter, so the page works with any total. Percents from a lab often add to a little more or less than 100.

What order are the elements written in?

Hill order: carbon first, then hydrogen, then the other elements A to Z. Without carbon, every element goes A to Z, so Fe₂O₃ and CH₂O.