Empirical Formula Calculator

Empirical formulaCH2O
Moles in the sampleC 0.333 mol, H 0.665 mol, O 0.333 mol
Empirical molar mass30.03 g/mol
Molecular formulaC6H12O6
How this was calculated
  1. Moles of each element = mass / atomic mass: C 0.333 mol, H 0.665 mol, O 0.333 mol.
  2. Divide through by the smallest (0.333 mol): the raw ratios are C 1.00, H 2.00, O 1.00, already whole numbers.
  3. Empirical formula = CH2O, the simplest whole-number ratio, with an empirical molar mass of 30.03 g/mol.
  4. Molecular formula: 180.16 / 30.03 = 6.00, so the unit repeats 6 times and the molecular formula is C6H12O6.

This empirical formula calculator turns the masses of each element in a sample into the simplest whole-number ratio of atoms in the compound. It converts elemental masses to moles, then divides each by the smallest mole value to get the ratio. For example, 4 g C, 0.67 g H and 5.33 g O give 0.333, 0.665 and 0.333 mol, ratios of 1:2:1, and the empirical formula CH2O. When a molar mass is also known, the calculator goes one step further: with a measured molar mass of 180.16 g/mol against an empirical mass of 30.03 g/mol, the unit repeats 6 times and the molecular formula is C6H12O6, glucose.

The method behind the calculator is the accepted standard for this kind of calculation because it follows the definition directly: the empirical formula is the simplest whole-number ratio, and the molecular formula is a whole-number multiple of it set by the molar mass. That is why a hydrocarbon with 4.8044 g C and 1.008 g H gives a 1 : 2.50 ratio that only clears with a multiplier of 2, landing on C2H5 and, at 58.12 g/mol, C4H10. The same steps handle more complex samples, such as caffeine's analysis (4.8044 g C, 0.504 g H, 1.5999 g O, 2.8014 g N), which gives C 0.400, H 0.500, O 0.100 and N 0.200 mol, the empirical formula C4H5N2O, and doubling for 194.19 g/mol gives C8H10N4O2. This page shows the formula, step-by-step workings, worked examples and sources so you can check every result yourself.

Worked examples

Glucose analysis: 4.00 g C, 0.67 g H, 5.33 g O

Empirical formula = CH2O. Moles in the sample: C 0.333 mol, H 0.665 mol, O 0.333 mol; Empirical molar mass: 30.03 g/mol; Molecular formula: C6H12O6. (4 g · 0.67 g · 5.33 g · 0 g · 180.16 g/mol)

Empirical formulaCH2O
Moles in the sampleC 0.333 mol, H 0.665 mol, O 0.333 mol
Empirical molar mass30.03 g/mol
Molecular formulaC6H12O6

Caffeine analysis with nitrogen

Empirical formula = C4H5N2O. Moles in the sample: C 0.400 mol, H 0.500 mol, N 0.200 mol, O 0.100 mol; Empirical molar mass: 97.10 g/mol; Molecular formula: C8H10N4O2. (4.8044 g · 0.504 g · 1.5999 g · 2.8014 g · 194.19 g/mol)

Empirical formulaC4H5N2O
Moles in the sampleC 0.400 mol, H 0.500 mol, N 0.200 mol, O 0.100 mol
Empirical molar mass97.10 g/mol
Molecular formulaC8H10N4O2

A hydrocarbon: carbon and hydrogen only

Empirical formula = C2H5. Moles in the sample: C 0.400 mol, H 1.000 mol; Empirical molar mass: 29.06 g/mol; Molecular formula: C4H10. (4.8044 g · 1.008 g · 0 g · 0 g · 58.12 g/mol)

Empirical formulaC2H5
Moles in the sampleC 0.400 mol, H 1.000 mol
Empirical molar mass29.06 g/mol
Molecular formulaC4H10

From analysis to formula in three moves

An empirical formula calculator works the same way a chemist does on paper: turn each element's mass into moles, then divide every mole value by the smallest one to force the ratio into its simplest whole-number form. Glucose makes a clean example. Suppose analysis reports 4 g C, 0.67 g H and 5.33 g O. Dividing each mass by its atomic mass gives 0.333 mol C, 0.665 mol H and 0.333 mol O. Those are the raw mole amounts — not yet a formula.

Move two is the division by the smallest. Here the smallest value is 0.333 mol, so carbon becomes 1, hydrogen becomes 0.665 ÷ 0.333, which is 2, and oxygen becomes 1. The ratios read 1:2:1, and the empirical formula is CH2O. Notice that the mole numbers themselves were not whole numbers, but the ratio between them was. That is the whole point of the method: the ratio survives, the raw moles do not need to be integers.

Move three is optional and depends on what the problem gives you. The empirical formula is the simplest whole-number ratio; the molecular formula is a whole-number multiple of it set by the molar mass. If the measured molar mass is 180.16 g/mol and the empirical mass of CH2O is 30.03 g/mol, the unit repeats 6 times (180.16 ÷ 30.03), so the molecular formula is C6H12O6 — glucose. An empirical formula calculator typically stops at CH2O unless you supply that molar mass.

The same three moves handle messier data. Caffeine's analysis — 4.8044 g C, 0.504 g H, 1.5999 g O and 2.8014 g N — gives 0.400 mol C, 0.500 mol H, 0.100 mol O and 0.200 mol N. Dividing by 0.100 yields C4H5N2O, and doubling for a molar mass of 194.19 g/mol gives C8H10N4O2. A hydrocarbon with 4.8044 g C and 1.008 g H gives a 1 : 2.50 ratio, which only clears with a multiplier of 2, landing on C2H5 and, at 58.12 g/mol, C4H10. When a ratio lands on a fraction like 2.50, multiply every value by 2; fractions near 0.33 or 0.67 usually mean a multiplier of 3.

Glucose in one line: 4 g C, 0.67 g H, 5.33 g O → 0.333, 0.665, 0.333 mol → divide by 0.333 → 1:2:1 → CH2O. With a molar mass of 180.16 g/mol, 180.16 ÷ 30.03 = 6, so the molecular formula is C6H12O6.

When the ratios refuse to be whole

Not every set of mole ratios lands on whole numbers on the first try. A hydrocarbon with 4.8044 g C and 1.008 g H gives a 1 : 2.50 ratio, and 2.50 is not something you can round away without changing the chemistry. This is the point where an empirical formula calculator stops and asks for a multiplier, and it is also the point where many hand calculations go wrong. The ratio is real; it just needs a whole-number scale factor before it can be written as a formula.

For that hydrocarbon, the smallest value in the ratio is 1, so dividing by it leaves the hydrogen at 2.50. A multiplier of 2 turns 1 into 2 and 2.50 into 5, landing on C2H5. That is the empirical formula, and it is a legitimate one even though it looks unusual. If the measured molar mass is 58.12 g/mol, the empirical mass of C2H5 is half of that, so the unit repeats twice and the molecular formula is C4H10. The multiplier did two jobs at once: it cleared the fraction and it set the size of the final molecule.

The same logic covers other fractions. A ratio ending in thirds needs a multiplier of 3, and one ending in quarters needs a multiplier of 4. The rule is simple: look at the decimal part of the smallest non-whole value and pick the smallest multiplier that turns every entry into a whole number. A ratio of 1 : 1.33 : 2 becomes 3 : 4 : 6 with a multiplier of 3. A ratio of 1 : 1.25 becomes 4 : 5 with a multiplier of 4. Do not round 1.33 to 1 or 1.25 to 1; that changes the formula.

A word of caution is worth adding here. Real measurements carry uncertainty, so a ratio of 1 : 2.98 is almost certainly 1 : 3, and a ratio of 1 : 2.50 might be a genuine half or might be a slightly off measurement of something else. Good practice is to check how close the value sits to a simple fraction before committing to a multiplier. If the numbers are far from any clean fraction, the original masses may need rechecking.

Once the multiplier is chosen, the rest of the work is ordinary. The empirical formula is the simplest whole-number ratio, and the molecular formula is a whole-number multiple of it set by the molar mass. The multiplier search is the only step that requires judgment, and it is the step where a careful empirical formula calculator earns its keep by showing you the ratio and the multiplier rather than just the final answer.

A 1 : 2.50 ratio clears with a multiplier of 2 to give C2H5; thirds need a multiplier of 3 and quarters need 4.

Adding nitrogen to the picture

Caffeine is a good test case for an empirical formula calculator because it contains four elements, and the element order matters when you write the answer. A combustion-style analysis of caffeine reports 4.8044 g C, 0.504 g H, 1.5999 g O and 2.8014 g N. Convert each mass to moles, then divide every result by the smallest of the four. That gives C 0.400, H 0.500, O 0.100 and N 0.200 mol. Dividing by 0.100 yields the ratio 4 : 5 : 2 : 1, and the empirical formula is C4H5N2O.

The ordering C, H, N, O is a convention, not a chemical result. The ratio itself is what the analysis supports; carbon comes first, hydrogen second, and the remaining elements follow in alphabetical order, which places nitrogen before oxygen. So the formula is written C4H5N2O rather than C4H5ON2, even though both strings describe the same ratio. Keep that in mind when you check your own work: a different order is a formatting difference, not a calculation error.

Caffeine also shows how the empirical formula relates to the molecular formula. The empirical formula C4H5N2O has an empirical mass of about 97.1 g/mol, and doubling it gives C8H10N4O2, which matches the measured molar mass of 194.19 g/mol. The multiplier is 2 because 194.19 divided by the empirical mass is 2. The empirical formula is the simplest whole-number ratio; the molecular formula is a whole-number multiple of it set by the molar mass. For caffeine, that multiple happens to be 2.

Not every analysis lands on whole numbers on the first pass. A hydrocarbon with 4.8044 g C and 1.008 g H gives a ratio of 1 : 2.50. A ratio with a half in it cannot be an empirical formula, so multiply every value by 2 to clear the fraction. That lands on C2H5, and at 58.12 g/mol the molecular formula is C4H10. The same lesson applies to caffeine: if dividing by the smallest mole value had produced 2.5 instead of 2, you would double the ratio before writing the final formula.

When you use an empirical formula calculator, enter the measured masses and let it handle the mole conversions and the division by the smallest value. Then check two things yourself: that every ratio is a whole number or has been multiplied up to one, and that the elements appear in the conventional order C, H, then the rest alphabetically. For caffeine, those checks confirm C4H5N2O and, once the molar mass is applied, C8H10N4O2.

Caffeine: 4.8044 g C, 0.504 g H, 1.5999 g O, 2.8014 g N → C 0.400, H 0.500, O 0.100, N 0.200 mol → ratio 4 : 5 : 2 : 1 → C4H5N2O. Doubling for 194.19 g/mol gives C8H10N4O2.

Empirical vs molecular formula

The empirical formula and the molecular formula describe the same compound at two different levels of detail. The empirical formula is the simplest whole-number ratio of the atoms in a compound. The molecular formula is a whole-number multiple of that empirical formula, and the multiplier is set by the compound's measured molar mass. That relationship is why an empirical formula calculator is often only the first step: the ratio it returns may need to be scaled up to match the real molecule.

The scaling works by comparing two masses. Divide the measured molar mass by the mass of one empirical formula unit, and the result tells you how many times the unit repeats. For glucose, a measured molar mass of 180.16 g/mol against an empirical mass of 30.03 g/mol gives 180.16 / 30.03 = 6 repeats, so the molecular formula is C6H12O6. The empirical formula behind it, CH2O, comes from 4 g C, 0.67 g H and 5.33 g O, which give 0.333, 0.665 and 0.333 mol, ratios of 1:2:1.

Caffeine follows the same pattern with a different multiplier. Its analysis of 4.8044 g C, 0.504 g H, 1.5999 g O and 2.8014 g N gives C 0.400, H 0.500, O 0.100 and N 0.200 mol, which reduces to the empirical formula C4H5N2O. Doubling that unit for a molar mass of 194.19 g/mol gives C8H10N4O2, since 194.19 / 97.10 = 2.

A hydrocarbon example shows what happens when the ratio is not yet whole. With 4.8044 g C and 1.008 g H, the ratio comes out to 1 : 2.50, which only clears with a multiplier of 2, landing on C2H5. At a molar mass of 58.12 g/mol, the unit doubles again: 58.12 / 29.06 = 2, so the molecular formula is C4H10. In each case the arithmetic is the same — empirical mass times the repeat count equals the molecular mass — and that is the check to run on any empirical formula calculator result before you trust the final formula.

  • Glucose: 180.16 / 30.03 = 6 repeats; CH2O becomes C6H12O6.
  • Caffeine: 194.19 / 97.10 = 2 repeats; C4H5N2O becomes C8H10N4O2.
  • Butane: 58.12 / 29.06 = 2 repeats; C2H5 becomes C4H10.
The empirical formula is the simplest whole-number ratio; the molecular formula is a whole-number multiple of it, set by the measured molar mass.

FAQs

What is the empirical formula of glucose from its analysis?

Glucose analysis gives a mole ratio of 1:2:1 for carbon, hydrogen and oxygen, so the empirical formula is CH2O. The measured molar mass then scales that unit up to the molecular formula C6H12O6. The empirical formula is the simplest whole-number ratio, not necessarily the full molecule.

How many moles are in the caffeine sample?

The caffeine sample contains C 0.400 mol, H 0.500 mol, N 0.200 mol and O 0.100 mol. Dividing each by the smallest value, 0.100 mol, gives the whole-number ratio 4:5:2:1, so the empirical formula is C4H5N2O.

What if a ratio comes out at 2.5?

A ratio of 1 : 2.50 is not whole numbers, so multiply every ratio by 2. That turns 1 : 2.50 into 2 : 5, giving C2H5, the butane unit. Always multiply by the smallest factor that makes all the ratios whole numbers.

How does molar mass give the molecular formula?

Divide the measured molar mass by the empirical mass. For glucose, 180.16 / 30.03 = 6, so every subscript in the empirical formula multiplies by 6. That takes CH2O to C6H12O6. The result should be a whole number; a value near a whole number confirms the scaling factor.

What is the empirical mass of CH2O?

The empirical mass of CH2O is 30.03 g/mol. Glucose's measured molar mass is 180.16 g/mol. Dividing 180.16 by 30.03 gives 6, the factor that scales the empirical formula up to the molecular formula C6H12O6.

Which elements does the calculator handle?

The calculator handles carbon, hydrogen, nitrogen and oxygen. These are the four elements of a standard organic combustion analysis, so the tool fits the usual data from burning an organic sample and measuring the products.

Sources

Related calculators

Stoichiometry Calculator
Convert between mass, moles, particle count and gas volume at STP through the molar mass, with Avogadro's number and the 22.414 L molar volume.
Percent Yield Calculator
Percent yield from actual and theoretical yields, the theoretical yield behind an actual result, or the expected actual yield, with the shortfall in grams.
Molarity Calculator
Concentration from a weighed mass: moles from the molar mass, then moles per litre of finished solution — the everyday molarity preparation calculation for labs and classrooms.
Titration Calculator
Find an unknown analyte concentration from titrant molarity, titre volume and the stoichiometric ratio, with millimole steps shown.