Empirical Formula Calculator - Mass to Integer Subscripts

Free empirical formula calculator converting element masses in grams into the smallest whole-number subscripts using IUPAC atomic weights and the smallest-mole divisor step.

Updated: June 23, 2026 • Free Tool

Empirical Formula Calculator

Mass of carbon in the sample, in grams. Enter 0 if carbon is absent.

Mass of hydrogen in the sample, in grams. Enter 0 if hydrogen is absent.

Mass of oxygen in the sample, in grams. Enter 0 if oxygen is absent.

Mass of nitrogen in the sample, in grams. Enter 0 if nitrogen is absent.

Mass of sulfur in the sample, in grams. Enter 0 if sulfur is absent.

Results

Empirical formula
0
Empirical formula mass 0g/mol
Smallest mole count (divisor) 0mol
Elements present 0

What Is the Empirical Formula Calculator?

The empirical formula calculator turns the measured masses of elements in a compound into the smallest whole-number subscripts of the empirical formula. Use it for homework problems, lab-report conversions, and percent-composition reverse calculations.

  • General chemistry homework: Solve textbook problems where you are given element masses and asked for the simplest whole-number ratio.
  • Combustion analysis follow-up: Convert CO2 and H2O masses from a CHN burn into the empirical formula before extending to the molecular formula.
  • Percent composition reverse: Take percent-by-mass data, treat it as grams in a 100 g sample, and recover the empirical subscripts the same way.
  • Quick ratio sanity checks: Verify that a guessed empirical formula matches the measured element masses.

The calculator divides each mass by its IUPAC atomic weight to get moles, then divides every element's mole count by the smallest non-zero count to recover the empirical subscripts. The result is the simplest whole-number ratio, written in Hill system order.

For percent composition data, divide each percent by its atomic weight and follow the same divisor step. The empirical formula is the gateway to the molecular formula with a separately measured molar mass.

If your raw data came from a CHN burn rather than direct element masses, Combustion Analysis Calculator recovers the empirical formula from CO2 and H2O masses using the same IUPAC atomic weights.

How the Empirical Formula Calculator Works

The calculator applies standard chemistry steps: convert each element's mass to moles using IUPAC atomic weights, divide every mole count by the smallest non-zero value, and scale the ratios to whole numbers.

molesX = massX / atomicWeightX | ratioX = molesX / min(moles) | subscriptX = round(ratioX × k)
  • massC, massH, massO, massN, massS: Measured masses of carbon, hydrogen, oxygen, nitrogen, and sulfur in grams. Enter 0 for any absent element.
  • atomic weights: IUPAC 2023 standard atomic weights: H 1.008, C 12.011, N 14.007, O 15.999, S 32.06 g/mol.
  • smallestMoles: The smallest non-zero mole count, used as the divisor for the empirical ratio step.
  • k: Smallest integer from 1 to 9 that makes every ratio an integer within 0.05.

When you enter element masses, the calculator treats any zero value as an absent element and excludes it from the divisor step. The smallest-mole divisor step converts raw mole counts into the simplest integer ratio and is the heart of the calculation.

The calculator checks scaled ratios (k from 1 to 9) and uses the smallest k within 0.05 of an integer. That k scales every ratio, then each rounds to the nearest integer for the empirical subscript. This handles a 1.5 ratio without forcing you to multiply by 2.

Worked example: glucose CH2O reference

massC = 12.011 g, massH = 2.016 g, massO = 15.999 g (massN = 0, massS = 0)

moles: C = 1.0000, H = 2.0000, O = 1.0000; smallest = 1.0000; ratios 1, 2, 1; k = 1; subscripts 1, 2, 1.

Empirical formula CH2O, empirical formula mass 30.026 g/mol, smallest mole count 1.0000 mol, 3 elements present.

Glucose C6H12O6 and formaldehyde CH2O share the empirical formula CH2O because the empirical formula captures the 1:2:1 ratio, not the actual atom count.

Worked example: methyl acetate C3H6O2 with k=2 multiplier

massC = 36.033 g, massH = 6.048 g, massO = 31.998 g (massN = 0, massS = 0)

moles 3.0, 6.0, 2.0; smallest 2.0; raw ratios 1.5, 3, 1; k = 2; subscripts 3, 6, 2.

Empirical formula C3H6O2, empirical formula mass 74.079 g/mol, smallest mole count 2.0000 mol, 3 elements present.

The 1.5 raw ratio between C and O means the smallest integer multiplier that makes every ratio whole is 2, so the calculator scales by k = 2 before rounding.

According to IUPAC Standard Atomic Weights 2023, the standard atomic weights used to convert element masses to moles are H 1.008, C 12.011, N 14.007, O 15.999, and S 32.06 g/mol.

According to Wikipedia Empirical Formula, the empirical formula of a compound is the simplest whole-number ratio of atoms it contains, illustrated by methyl acetate which converts from 48.64% C / 8.16% H / 43.20% O to the empirical formula C3H6O2.

When you need a refresher on how atomic weights turn grams into moles, Mole & Molar Mass Calculator walks through the gram-to-mole conversion for any element on the periodic table.

Key Concepts Explained

Four ideas show up in every empirical-formula calculation. Once you understand them, the calculator's outputs map onto the steps you would write on a worksheet.

Mole concept

Dividing the mass of an element by its IUPAC atomic weight yields the number of moles, the universal currency chemists use to compare amounts of different elements.

Smallest-mole divisor

Dividing every element's mole count by the smallest non-zero mole count gives the simplest integer ratio, which is the empirical formula's subscript pattern.

Hill system notation

When carbon is present, the empirical formula is written with carbon first and hydrogen second, then remaining elements alphabetically; without carbon, elements are alphabetical.

Empirical versus molecular formula

The empirical formula is the smallest integer ratio of elements; the molecular formula is a whole-number multiple that matches the measured molar mass.

These four ideas are the same steps you would write out by hand on a worksheet. Glucose C6H12O6 and formaldehyde CH2O share the empirical formula CH2O because both reduce to the same 1:2:1 ratio.

The gram-to-mole conversion is the first step of every empirical formula, so Grams to Moles Calculator is a good place to double-check the arithmetic for any single element.

How to Use This Calculator

Enter the masses you measured for each element, leave unused ones at zero, and let the calculator do the moles, division, and rounding.

  1. 1 Enter the mass of carbon: Type the grams of carbon, or leave at 0 to skip carbon from the empirical formula.
  2. 2 Enter the mass of hydrogen: Type the grams of hydrogen; most organic compounds have hydrogen, so this value is rarely 0.
  3. 3 Enter the mass of oxygen: Type the grams of oxygen, or 0 if the compound contains no oxygen.
  4. 4 Enter nitrogen and sulfur if present: Set the grams of nitrogen and sulfur if your compound contains them; otherwise leave both at 0.
  5. 5 Read the empirical formula: Use the formula for the homework answer or as input to a molecular-formula calculation.
  6. 6 Check the empirical formula mass: Divide the measured molar mass by this value to get n, then multiply every subscript by n for the molecular formula.

For 1.000 g of a compound containing 0.400 g C, 0.067 g H, and 0.533 g O, enter 0.4, 0.067, 0.533, 0, 0. The calculator reports CH2O with empirical formula mass 30.026 g/mol, smallest mole count 1.0000 mol, and 3 elements present.

Once you have the empirical formula in hand, Chemical Equation Balancer Calculator uses those subscripts to balance the full chemical equation for a combustion or synthesis reaction.

Benefits of Using This Calculator

The empirical formula calculator handles the mole math and smallest-mole division so you can focus on the chemistry decision after you have the formula.

  • Skip the moles-by-hand step: Enter element masses and the calculator divides each by its IUPAC atomic weight, removing the most common arithmetic slips.
  • Apply the smallest-mole rule automatically: No need to identify the smallest non-zero mole count yourself; the calculator reports it as its own output so you can verify the divisor.
  • Use Hill system ordering: The empirical formula is written with carbon first, hydrogen second, then remaining elements alphabetically, matching the convention in textbooks.
  • Cover five common elements: Carbon, hydrogen, oxygen, nitrogen, and sulfur are the five elements most often seen in organic empirical-formula problems.
  • Pair with a molecular formula step: Feed the empirical formula mass into a molar-mass ratio to recover the molecular formula without re-entering the masses.
  • Mobile-friendly in lab or library: Real-time recalculation lets you try different masses on a phone while reading a sample off the balance.

Use the empirical formula output to answer the first half of the worksheet, then move to the molecular formula only when the problem gives a molar mass. If the elements-present count does not match what you expected, double-check the input fields; a stray zero in the wrong row silently drops an element from the formula.

The empirical formula is also the starting point for reaction stoichiometry, and Stoichiometry Reaction Calculator converts those subscripts into theoretical product yields for a balanced reaction.

Factors That Affect Your Results

The arithmetic is exact, but your inputs and assumptions about the compound affect the results.

Element coverage

This calculator handles C, H, O, N, and S; compounds with phosphorus, halogens, or transition metals need a different atomic-weight set.

Purity of the sample

An impure sample skews the element masses and produces an empirical formula that does not match any single compound; run the analysis on a recrystallized sample.

Rounding of subscripts

Borderline raw ratios (1.49 versus 1.51) round to different integers and may need an integer multiplier; the calculator tries k from 1 to 9 to recover the cleanest ratio.

Zero masses for absent elements

Leaving the unused element at 0 excludes it from the formula; an unintentional 0 silently drops that element from the empirical subscripts.

Percent composition as input

To use percent values, divide each percent by its atomic weight first and treat those ratios as moles; the empirical formula does not care whether the source was grams or percents.

  • Empirical formula only: this calculator does not produce a molecular formula unless you multiply every empirical subscript by an integer n that matches a separately measured molar mass.
  • Borderline rounding: a 1.49 ratio rounds down to 1 and a 1.51 rounds up to 2; if your data sits between, double-check with a more precise measurement.
  • Hill system assumption: when carbon is absent, the calculator sorts elements alphabetically, which differs from the strict Hill system requirement that forces alphabetical order whenever no C is present.

Treat the calculator's outputs as a starting point and confirm them against your lab report. The empirical formula and percent composition must round-trip through the same atomic weights.

If the smallest mole count is below 1e-6 mol, check the input masses; the displayed moles may need a sanity check against your balance's readability.

According to LibreTexts Determining Empirical Formulas, an empirical formula is found by assuming a 100 g sample, converting grams of each element to moles, dividing every mole count by the smallest, and rounding to whole-number subscripts.

When the empirical-formula math leads to a percent-composition question on the same homework set, Alligation Calculator handles the mixture-style mass-percent problems that show up alongside it.

Empirical formula calculator converting element masses in grams into smallest-integer subscripts for C, H, O, N, and S.
Empirical formula calculator converting element masses in grams into smallest-integer subscripts for C, H, O, N, and S.

Frequently Asked Questions

Q: What is the empirical formula of a compound?

A: The empirical formula is the simplest whole-number ratio of the elements present in a compound. It captures the smallest integer subscripts that are consistent with the measured element masses, but it does not show the actual number of atoms in a molecule.

Q: How do you find the empirical formula from element masses?

A: Divide the mass of each element by its IUPAC atomic weight to get the mole count, divide every mole count by the smallest non-zero value to get the raw ratios, and then scale every ratio by the smallest integer k that makes all of them whole numbers within 0.05.

Q: How do you find the empirical formula from percent composition?

A: Treat each percent as grams in a 100 g sample, then run the same gram-to-mole and smallest-mole-divisor steps as you would for measured masses. The empirical subscripts do not depend on whether the source data were grams or percentages.

Q: What is the empirical formula for glucose?

A: Glucose C6H12O6 has the empirical formula CH2O because the 6:12:6 mole ratio reduces to 1:2:1. Formaldehyde CH2O shares the same empirical formula even though it is a smaller molecule.

Q: How do you round mole ratios to whole numbers?

A: The calculator tries integer multipliers k from 1 to 9 and uses the smallest k that brings every scaled ratio within 0.05 of an integer. For methyl acetate the raw ratios are 1.5, 3, and 1, so k = 2 yields the empirical formula C3H6O2.

Q: What is the difference between empirical and molecular formula?

A: The empirical formula is the simplest integer ratio of elements; the molecular formula is a whole-number multiple of the empirical subscripts that matches the measured molar mass. Divide the measured molar mass by the empirical formula mass to find that integer multiple.