# What is the empirical formula?

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.

- Page: https://www.acalculator.org/chemistry/empirical-formula-calculator
- JSON spec: https://www.acalculator.org/chemistry/empirical-formula-calculator.json
- Version: 339b71eba114

## Default answer

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.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| basis | Amounts are | Whether each amount is a percent by mass or a mass in grams. |
| parts | Elements | One row per element in the compound: the element and its amount. |
| mm | Molar mass (g/mol) | The compound’s molar mass, to find the molecular formula. Leave empty to skip. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| formula | Empirical formula | The simplest whole-number ratio of atoms, in Hill order (C, then H, then A to Z). |
| molecular | Molecular formula | The empirical formula times the whole number n that matches the molar mass. |
| n | Formula units per molecule (n) | Molar mass ÷ empirical formula mass, rounded to a whole number. |
| mass | Empirical formula mass (g/mol) | The sum of the atomic weights in the empirical formula. |
| ratios | Mole ratios | Each element’s moles divided by the smallest, to 4 significant digits. |
| multiplier | Ratios multiplied by | The smallest whole number, 1 to 10, that brings every ratio within 0.1 of a whole number. |

## 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).

## Assumptions

- 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.

## Worked examples

1. basis = grams, parts = {"el":"Fe","amt":34.97} or {"el":"O","amt":15.03} gives formula = Fe₂O₃, multiplier = 2, mass = 159.687, 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. basis = percent, parts = {"el":"C","amt":27.29} or {"el":"O","amt":72.71} gives formula = CO₂, multiplier = 1, mass = 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. basis = percent, parts = {"el":"C","amt":74.02} or {"el":"H","amt":8.71}, mm = 162.3 gives formula = C₅H₇N, molecular = C₁₀H₁₄N₂, n = 2, mass = 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. basis = percent, parts = {"el":"C","amt":40} or {"el":"H","amt":6.71}, mm = 180.16 gives formula = CH₂O, molecular = C₆H₁₂O₆, n = 6, mass = 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.

## FAQ

### 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.

## Sources

- OpenStax, Chemistry 2e, §3.2 Determining Empirical and Molecular Formulas (Example 3.11: hematite, Fe₂O₃; Example 3.12: CO₂ from 27.29% C and 72.71% O; Example 3.13: nicotine, C₅H₇N and C₁₀H₁₄N₂). https://openstax.org/books/chemistry-2e/pages/3-2-determining-empirical-and-molecular-formulas (retrieved 2026-10-02)
- Commission on Isotopic Abundances and Atomic Weights (CIAAW), Abridged Standard Atomic Weights (2024). https://ciaaw.org/abridged-atomic-weights.htm (retrieved 2026-10-02)
