---
slug: empirical-formula-calculator
title: "Empirical Formula Calculator"
category: scientific
updated: 2026-11-18
canonical: https://calcseed.com/c/scientific/empirical-formula-calculator/
html: /c/scientific/empirical-formula-calculator/
---

# Empirical Formula Calculator

Determine the empirical formula of a compound from the masses of two elements and their molar masses.

## Quick answer

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

## Default calculation

Values computed by this calculator at exactly the default inputs listed below.

### Inputs (defaults)

| Input | Value | Unit |
| --- | --- | --- |
| Mass of element A | 12 | g |
| Molar mass of A | 12 | g/mol |
| Mass of element B | 4 | g |
| Molar mass of B | 1 | g/mol |

### Outputs at these defaults

| Output | Value | Unit |
| --- | --- | --- |
| Subscript of A | 1 |  |
| Subscript of B | 4 |  |

## Formula

```text
moles = mass ÷ molar mass
```

## Inputs

| Variable | Type | Unit | Default |
| --- | --- | --- | --- |
| Mass of element A | number | g | 12 |
| Molar mass of A | number | g/mol | 12 |
| Mass of element B | number | g | 4 |
| Molar mass of B | number | g/mol | 1 |

## Outputs

| Result | Format |
| --- | --- |
| Subscript of A | primary |
| Subscript of A | number |
| Subscript of B | number |

## How it works

### What this calculator returns

It returns the two subscripts of the simplest whole-number formula, A_x_B_y_. 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 CH_4_. Masses are in grams and molar masses in g/mol.

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

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

| Sample | Moles of A | Moles of B | Ratio | Formula |
| --- | --- | --- | --- | --- |
| 12 g C (12) + 4 g H (1) | 1.00 | 4.00 | 1 : 4 | CH_4_ |
| 2 g H (1) + 16 g O (16) | 2.00 | 1.00 | 2 : 1 | H_2_O |
| 23 g Na (23) + 35.5 g Cl (35.5) | 1.00 | 1.00 | 1 : 1 | NaCl |
| 56 g Fe (56) + 24 g O (16) | 1.00 | 1.50 | 2 : 3 | Fe_2_O_3_ |
| 14 g N (14) + 32 g O (16) | 1.00 | 2.00 | 1 : 2 | NO_2_ |

#### 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 FeO_2_, which is wrong on both counts. Doubling to 2 : 3 gives Fe_2_O_3_, 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&rsquo;s measured molar mass by the empirical formula mass. Glucose has empirical CH_2_O 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 C_6_H_12_O_6_.

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.

- CH_2_O 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 O_2_, so 32 g of O_2_ is 1 mol of O_2_ 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&rsquo;s atomic number is 6, so 12 g ÷ 6 gives 2 mol and the formula drifts to C_2_H_4_. 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 CH_2_O. Run the two-element calculator twice if you need to pair the elements up.

## FAQ

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

### What is the difference between empirical and molecular formula?

Empirical is the reduced ratio, molecular is the actual count. Glucose is CH_2_O empirically and C_6_H_12_O_6_ 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 Fe_2_O_3_, not FeO_2_.

### 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 CH_4_ both ways, and water is H_2_O 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 CH_2_O.

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

## Method and sources

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

Last updated: 2026-11-18.
- Empirical formula from moles = mass / molar mass and reduction to the smallest whole-number ratio.
