Empirical Formula Calculator
Type the mass percent (or grams) of each element to get the simplest whole-number…
Type the mass percent (or grams) of each element to get the simplest whole-number formula, and the molar mass to get the molecular formula, with the mole ratios worked out.
Leave one percentage blank to work it out by difference from 100%.
ExampleMolecular formula
C6H8O6
The empirical formula is C₃H₄O₃ (88.062 g/mol); 176.12 ÷ 88.062 = 2, so the molecule is 2 of those units.
Type your own composition.
- C3.000 → 3
- H4.001 → 4
- O3.000 → 3
- Empirical formula
- C₃H₄O₃
- Empirical formula mass
- 88.062 g/mol
- Molecule = empirical ×
- 2
How this works: 5 sources,
How this works
Method
Assume 100 g of the compound, so each mass percent becomes grams. Divide each element’s grams by its atomic weight to get moles. Vitamin C is 40.92% carbon, 4.58% hydrogen and 54.50% oxygen, which gives 40.92 ÷ 12.011 = 3.407 mol C, 4.58 ÷ 1.008 = 4.544 mol H and 54.50 ÷ 15.999 = 3.406 mol O. Full method
Sources
- OpenStax Chemistry 2e, 3.2 Determining Empirical and Molecular Formulas
- PubChem, Ascorbic acid (CID 54670067)
- CIAAW, Standard Atomic Weights 2024 (Atomic Weights 2021 report with the 2024 revisions) (2024)
- BIPM, The International System of Units (SI Brochure), 9th edition (2019)
- OpenStax Chemistry 2e, chapters 3 and 4
How it’s tested
2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Privacy
On your device. Nothing you enter or open leaves this browser. About privacy labels
Changes
- First published: molar mass with each element’s share of the mass and atoms, grams to moles and back, percent composition, empirical formula, limiting reagent, theoretical and percent yield.
How to find an empirical formula
Assume 100 g of the compound, so each mass percent becomes grams. Divide each element’s grams by its atomic weight to get moles. Vitamin C is 40.92% carbon, 4.58% hydrogen and 54.50% oxygen, which gives 40.92 ÷ 12.011 = 3.407 mol C, 4.58 ÷ 1.008 = 4.544 mol H and 54.50 ÷ 15.999 = 3.406 mol O.
Divide every mole amount by the smallest one, here 3.406, to get the ratio 1 : 1.334 : 1. When a ratio ends in about .33, .5, .25 or .67, multiply everything by the small whole number that clears it: × 3 gives 3 : 4 : 3, so the empirical formula is C3H4O3. The tool tries multipliers from 1 to 10 and takes the first that brings every ratio within 0.1 of a whole number.
The empirical formula is only the simplest ratio. The molecule can be any whole-number multiple of it, and the molar mass decides which. C3H4O3 weighs 88.06 g/mol; vitamin C’s measured molar mass is about 176.12 g/mol, twice that, so its molecular formula is C6H8O6 (176.12 g/mol).
moles = mass ÷ atomic weight; ratio = moles ÷ smallest; × k until whole
- The empirical formula gives the simplest whole-number ratio of atoms; the molecular formula is a whole-number multiple of it, found from the molar mass. Source: OpenStax Chemistry 2e, 3.2 Determining Empirical and Molecular Formulas.
- Ascorbic acid (vitamin C) has the molecular formula C6H8O6. Source: PubChem, Ascorbic acid (CID 54670067).
Different compounds, same empirical formula
Molecular formulas and the simplest ratios they reduce to, with the multiple n. Compounds that share a row’s empirical formula have exactly the same percent composition.
| Compound | Molecular formula | Empirical formula | n | Molar mass (g/mol) |
|---|---|---|---|---|
| Formaldehyde | CH₂O | CH₂O | 1 | 30.026 |
| Acetic acid | C₂H₄O₂ | CH₂O | 2 | 60.052 |
| Lactic acid | C₃H₆O₃ | CH₂O | 3 | 90.078 |
| Ribose | C₅H₁₀O₅ | CH₂O | 5 | 150.13 |
| Glucose | C₆H₁₂O₆ | CH₂O | 6 | 180.156 |
| Acetylene | C₂H₂ | CH | 2 | 26.038 |
| Benzene | C₆H₆ | CH | 6 | 78.114 |
| Styrene | C₈H₈ | CH | 8 | 104.152 |
| Hydrogen peroxide | H₂O₂ | HO | 2 | 34.014 |
| Ethane | C₂H₆ | CH₃ | 2 | 30.07 |
Show all 13 rowsShow fewer
| Octane | C₈H₁₈ | C₄H₉ | 2 | 114.232 |
| Vitamin C | C₆H₈O₆ | C₃H₄O₃ | 2 | 176.124 |
| Hydrazine | N₂H₄ | NH₂ | 2 | 32.046 |
Common questions
What if the ratios aren’t close to whole numbers?
Multiply them all by 2, 3, 4 and so on until they are. A ratio of 1.5 needs × 2, 1.33 or 1.67 needs × 3, and 1.25 or 1.75 needs × 4. If nothing up to 10 works, the percentages were probably rounded too far.
What does “by difference” mean?
Lab analyses often measure every element except oxygen and take oxygen as whatever is left of 100%. Leave one percentage blank here and it is filled in that way.
Can I use grams instead of percentages?
Yes. Only the ratios matter, so grams from a combustion analysis or a reaction work the same way. Switch to Grams above the boxes.
How do I get the molecular formula?
Divide the molar mass by the empirical formula’s mass and round to a whole number n, then multiply every subscript by n. Type the molar mass in the box and it is done for you.