HomeChemistry › Empirical Formula Calculator

Empirical Formula Calculator

Converts the mass percentages (or masses) of each element into moles, divides by the smallest amount and scales to the smallest whole-number ratio to give the empirical formula; with a molar mass it also returns the molecular formula.

When to use

You have elemental analysis data (mass percent or grams of each element) and need the empirical formula, or the molecular formula when the compound's molar mass is known.

Do not use when: You start from a formula and need its percent composition or molar mass (use molar-mass), or the data are moles of each element already (write them as the counts directly).

Formula

moles_i = mass_percent_i / atomic_weight_i; ratio_i = moles_i / min(moles); subscript_i = round(ratio_i × f) for the smallest integer f (1–12) that makes every ratio_i × f within 0.1 of an integer; n = round(molar_mass / empirical_formula_mass); molecular formula = (empirical formula)_n

Percentages are treated as grams of a 100 g sample, so masses in grams give the same result. Atomic weights are the IUPAC 2021 abridged values; ratios that stay more than 0.1 from an integer for every multiplier up to 12 are rounded with the best multiplier and flagged in a note.

Inputs

ParameterTypeUnitRequiredDescription
compositionstring_listyesElement symbols each followed by its mass percent or mass in grams, e.g. ["C 40.0", "H 6.7", "O 53.3"] or the single string "C 40.0, H 6.7, O 53.3" (also C:40.0 or C=40.0). Symbols are case-sensitive.
molar_mass_g_molnumberg/molnoMolar mass of the compound (e.g. from mass spectrometry or colligative properties); when given, the molecular formula is derived. Range: > 0, ≤ 10000000

Outputs

OutputTypeUnitDescription
empirical_formulastringSimplest whole-number ratio of atoms, with the elements in the order they were entered.
empirical_formula_mass_g_molnumberg/molMolar mass of one empirical formula unit.
molecular_formulastringEmpirical formula multiplied by molecular_multiplier (only when molar_mass_g_mol is given).
molecular_multiplierintegermolar_mass_g_mol / empirical formula mass, rounded to the nearest integer.
molecular_formula_mass_g_molnumberg/molMolar mass of the molecular formula found (compare with the input molar mass).
ratio_multiplierintegerFactor applied to the mole ratios to reach whole numbers (e.g. 2 when a ratio ends in .5).
elementslistPer element: symbol, mass (or percent) given, atomic weight, moles, ratio to the smallest and the subscript in the empirical formula.
total_massnumberSum of the values entered (should be about 100 for percentages).

Example

C 40.0 %, H 6.7 %, O 53.3 %, molar mass 180.16: {"composition":["C 40.0","H 6.7","O 53.3"],"molar_mass_g_mol":180.16}{"empirical_formula":"CH2O","empirical_formula_mass_g_mol":30.026,"molecular_formula":"C6H12O6","molecular_multiplier":6,"molecular_formula_mass_g_mol":180.156,"ratio_multiplier":1,"total_mass":100}

Hematite: Fe 69.94 %, O 30.06 %: {"composition":"Fe 69.94, O 30.06"}{"empirical_formula":"Fe2O3","empirical_formula_mass_g_mol":159.687,"ratio_multiplier":2}

GET https://tttkmbb.com/api/v1/calculate/empirical-formula?composition=C+40.0%2CH+6.7%2CO+53.3&molar_mass_g_mol=180.16

Machine access

Sources

FAQ

My ratios come out as 1.33 or 1.5. What happens?

The calculator multiplies all ratios by the smallest integer (3 or 2 here) that turns them into whole numbers, which is how Fe2O3 or C3H8 arise from 1 : 1.5 or 1 : 2.67 ratios.

Can I enter grams instead of percentages?

Yes. Only the ratios matter, so masses from a combustion analysis (e.g. grams of C, H and O) work directly; the sum of inputs is reported so you can check it.

Why does the molecular formula mass differ slightly from my molar mass?

The multiplier is rounded to an integer; the reported molecular_formula_mass_g_mol is the exact mass of the formula found. A multiplier far from an integer (flagged in a note) suggests an error in the data.

Related calculators