Empirical Formula Calculator – From Percent Composition to the Simplest Formula

Enter the percent of each element to get the moles, the ratios, and the simplest whole-number formula.

100% FreeNo sign-up neededInstant results

Your numbers

Enter element symbols and mass percents. Leave a row blank to skip it. The same math works if you enter masses in grams instead of percents.

Advanced options — fourth element and molar mass

Leave blank for the empirical formula only. Enter a molar mass to also get the molecular formula.

A fourth element and the molar mass are already included in the result with their default values — open Advanced options to change them.

Your numbers never leave this page. Everything is calculated in your browser.

Your result

Empirical formula
CH₂O
C 40% · H 6.7% · O 53.3% → simplest ratio 1 : 2 : 1

Step by step

Carbon (C): moles3.3303
Carbon (C): ratio1.0000
Hydrogen (H): moles6.6468
Hydrogen (H): ratio1.9959
Oxygen (O): moles3.3315
Oxygen (O): ratio1.0004

Formula masses

Empirical formula mass30.026 g/mol
Multiplier—
Molecular formula—
Molecular mass—
Tolerance note: a ratio within 0.05 of a whole number after multiplying counts as that whole number. Here 1.9959 counts as 2, so the formula is exact, not approximate.
Copied

Worked example: the CH2O case, step by step

The classic classroom example, with every number shown, so you can check the calculator by hand.

ElementPercentAtomic weightMolesRatioSubscript
C4012.0113.33031.00001
H6.71.0086.64681.99592
O53.315.9993.33151.00041

Smallest moles value is carbon, 3.3303. Dividing each mole value by it gives 1 : 1.9959 : 1.0004, and 1.9959 is within 0.05 of 2, so the formula is CH2O. With a molar mass of 180, the multiplier is 180 divided by 30.026, rounded to 6, giving the molecular formula C6H12O6.

Key takeaways
  • Divide each percent by its atomic weight, then divide every mole value by the smallest one.
  • Multiply all ratios by the same small number until they are whole — within 0.05 counts.
  • Add a molar mass to turn the empirical formula into the molecular formula.

How it works

1

Enter percents

Type an element symbol and its mass percent on each row. Two or more elements are needed.

2

Read the ratios

Each percent is divided by its atomic weight to give moles, then every value is divided by the smallest one.

3

Get the formula

Ratios are turned into the smallest whole numbers. Add a molar mass to also get the molecular formula.

moles = mass percent ÷ atomic weight  →  ratio = moles ÷ smallest moles  →  whole-number subscripts

Worked check, iron oxide: Fe 69.9% and O 30.1% give 1.2517 and 1.8814 moles, a ratio of 1 : 1.5031, and multiplying by 2 gives 2 : 3.0062, so the formula is Fe2O3. A ratio that needs multiplying by more than 8 is reported as approximate instead of forced.

Why ratios sometimes need multiplying

A ratio of 1 : 1.5 means the true subscripts are 2 : 3, not 1 : 2. Rounding 1.5 down to 1 or up to 2 would both be wrong. The calculator tries multipliers from 1 to 8 and picks the smallest one that brings every ratio within 0.05 of a whole number, then divides out any common factor.

Percent composition should add up to 100, and a sum outside 99 to 101 triggers a warning, not an error, because the same steps work on plain masses in grams. Published percents are often rounded, so a ratio like 1.9959 counting as 2 is normal and expected, and the calculator says so on the result.

Enter the percent of each element and this calculator works out the moles, the ratios, and the simplest whole-number formula. Add a molar mass and it finds the molecular formula too.

From percents to a formula, step by step

An empirical formula shows the simplest whole-number ratio of the atoms in a compound. It tells you the proportions, not the total number of atoms in one molecule. Getting there from percent composition takes three steps, and the calculator shows every one of them, so you can follow the arithmetic instead of trusting a single answer.

Step one is moles. Divide each element’s percent by its atomic weight. Step two is ratios. Divide every mole value by the smallest mole value, so the smallest element becomes 1 and the others become numbers relative to it. Step three is whole numbers. Multiply all the ratios by the same small number, usually 2, 3 or 4, until every ratio is close to an integer, and those integers are the subscripts of the empirical formula.

The page’s default example makes the steps concrete. With carbon 40%, hydrogen 6.7% and oxygen 53.3%, the mole values come out as carbon 3.3303, hydrogen 6.6468 and oxygen 3.3315. Dividing each by the smallest, 3.3303, gives ratios of carbon 1.0000, hydrogen 1.9959 and oxygen 1.0004. Hydrogen’s 1.9959 is within 0.05 of 2, which this calculator accepts as whole, so the ratios become 1 : 2 : 1 and the empirical formula is CH2O, with an empirical mass of 30.026 grams per mole.

ElementPercentMolesRatioWhole number
C403.33031.00001
H6.76.64681.99592
O53.33.33151.00041

Two things about this example are worth noticing. First, the hydrogen ratio is not exactly 2, and that is normal: published percents are often rounded, so a ratio like 1.9959 counting as 2 is expected, and the calculator says so on the result. Second, the empirical formula CH2O does not by itself say how many atoms are in one molecule. It says the proportions are one carbon to two hydrogens to one oxygen. The actual molecule could be CH2O, or C2H4O2, or C6H12O6, and telling those apart needs one more piece of information: the molar mass.

The method works the same way for any combination of elements the page supports. Enter the percent of each element, check that the mole and ratio steps look sensible, and read the formula off the whole-number ratios. If a ratio lands far from any whole number even after multiplying, something is usually wrong with the inputs, and the next sections cover the two most common causes: a missing element, and percents that were rounded too far.

From empirical to molecular formula

The empirical formula gives proportions. The molecular formula gives the actual count of each atom in one molecule. The bridge between them is the molar mass: divide the measured molar mass by the empirical mass, and the result, rounded to a whole number, is the multiplier that scales every subscript in the empirical formula up to the molecular formula.

Take the default example again. The empirical formula CH2O has an empirical mass of 30.026 grams per mole. Enter a molar mass of 180, and the multiplier is 180 divided by 30.026, which is about 6. Multiplying every subscript in CH2O by 6 gives C6H12O6, and the calculator shows a molecular mass of 180.156 grams per mole for it. The proportions are unchanged, one carbon to two hydrogens to one oxygen, but the molecule now has six of each unit instead of one.

The multiplier only makes sense when it lands near a whole number. A multiplier of about 6, or about 2, or about 1, points to a real molecular formula. A multiplier of 6.5 or 3.3 points to a problem instead: either the molar mass is wrong, the empirical formula is wrong, or the percents were rounded too far for the division to be clean. In that case, check the percents first, then the molar mass, before accepting any scaled formula, because scaling an incorrect empirical formula by a fractional multiplier only produces a more confident-looking wrong answer.

When no molar mass is entered, the calculator correctly stops at the empirical formula. That is not a missing feature: without a molar mass there is no way to distinguish CH2O from C2H4O2 or C6H12O6, since all three have the same proportions. The molar mass field sits in Advanced options, because most users working from percent composition start with the empirical formula, and only add the molar mass when they have a measured value to scale by. The default molar mass is already included in the result, so opening Advanced options is only needed when you want to change it.

A second worked example shows the method at its simplest. With hydrogen 11.19% and oxygen 88.81%, the mole values are hydrogen 11.1012 and oxygen 5.5510, the ratios are hydrogen 1.9999 and oxygen 1.0000, and the formula is H2O, with an empirical mass of 18.015 grams per mole. Here the hydrogen ratio is within 0.0001 of 2, so no multiplying step is needed at all, and the empirical formula is already the whole story unless a molar mass says otherwise.

When ratios do not come out whole

Most textbook examples divide neatly. Real analyses often do not, and the difference is usually rounding, not chemistry. Published percents are rounded to one or two decimal places, so the mole values and ratios inherit small errors, and a ratio that should be exactly 2 may arrive as 1.9959 or 2.0043. This calculator accepts a ratio within 0.05 of an integer after multiplying, and it says so when the result is only approximate, which is the honest way to handle rounded inputs.

The classic case for multiplying is iron(III) oxide. With iron 69.94% and oxygen 30.06%, the mole values are iron 1.2524 and oxygen 1.8789, and dividing by the smallest gives iron 1.0000 and oxygen 1.5002. Neither 1 nor 1.5 is a whole-number subscript, but multiplying both by 2 gives 2 and 3.0004, which is within tolerance of whole numbers, so the formula is Fe2O3, with an empirical mass of 159.687 grams per mole. The multiplying step is not fudging: it is the same operation as writing a half as a ratio of wholes, and it must be applied to every ratio at once, never to one element alone.

Multiplying by 2 handles halves, by 3 handles thirds, and by 4 handles quarters, and those three multipliers cover nearly every case that arises from real compounds. If no small multiplier brings all ratios within 0.05 of whole numbers, stop and check the inputs before trusting any formula. The most common cause is a missing element: if the percents add to well under 100, an element is absent from the calculation, and every ratio is distorted. The second most common cause is a mistyped percent or a wrong element symbol, which shifts one mole value and breaks all the ratios that depend on it.

Compounds with four elements need the fourth element pair, which lives in Advanced options along with the molar mass. The main form shows three element pairs, because three covers the most common teaching examples, and the fourth pair is already included in the result with its default values, so opening Advanced options is only needed when your compound actually has a fourth element. Enter its symbol and percent there, and it joins the same three steps: moles, ratios, then multiplication to whole numbers.

Finally, remember what the empirical formula cannot tell you. It gives proportions, not identity: different compounds can share an empirical formula, and the same empirical formula can belong to molecules of different sizes. The molecular formula needs a molar mass, the structure needs more evidence than composition alone, and the name of a compound needs its structure. Used inside those limits, the three steps on this page turn any percent composition into a defensible formula, with every intermediate value visible for checking.

Reading the result: what each number means

The result panel shows several numbers, and each one answers a different question. The moles answer how much of each element is present relative to its atomic weight. The ratios answer how the elements compare with each other, with the smallest set to 1. The whole numbers answer what subscripts go in the formula. The empirical mass answers how heavy one mole of the empirical unit is. And the molecular formula, when a molar mass is given, answers how many empirical units make one real molecule.

Read them in order, because each step checks the previous one. If the moles look wrong, the ratios will be wrong too, and the fault is in the percents or the symbols, not in the later steps. If the moles look right but the ratios look strange, check the division: the smallest mole value becomes 1, and every other ratio is that element’s moles divided by the smallest. If the ratios look right but no small multiplier makes them whole, the inputs are probably incomplete, and the missing element is the first suspect.

The hydrogen case shows why the tolerance matters. With hydrogen 11.19% and oxygen 88.81%, the moles are hydrogen 11.1012 and oxygen 5.5510, and the ratios are hydrogen 1.9999 and oxygen 1.0000. Nobody would refuse to call 1.9999 equal to 2, and the calculator does not either: anything within 0.05 of a whole number after multiplying counts as whole. The approximate flag appears when a ratio needed that tolerance, and it is information, not a warning: it tells you the inputs were rounded, so the formula is right to the precision the inputs allow.

The empirical mass is the check on the formula itself. For CH2O it is 30.026 grams per mole, for H2O it is 18.015, and for Fe2O3 it is 159.687. If you know roughly what the mass should be, compare: a mass that is wildly off suggests a wrong subscript, while a mass that matches confirms the proportions. The molecular mass plays the same role for the scaled formula: C6H12O6 at 180.156 grams per mole is six times the CH2O empirical mass, which is exactly what a multiplier of 6 should give.

Finally, notice what the result does not claim. It does not name the compound, because proportions alone cannot identify one. It does not give the structure, because the same formula can describe different arrangements. And it does not certify the analysis, because rounded or incomplete percents produce a formula that is only as good as its inputs. What it does, reliably, is show every intermediate value, so that any chemist checking the work can follow the same three steps and arrive at the same formula.

Common percent-composition problems

The most common problem is percents that do not add to about 100. If your percents add to 85, an element is missing from the analysis or from your entry, and every ratio is distorted because the missing element’s moles are absent from the division. If they add to 115, something is double-counted or mistyped. Either way, fix the inputs before trusting the formula: add the missing element, using the fourth element pair in Advanced options if you already have three, or find the typo. A formula computed from incomplete percents is not approximately right; it is wrong in a way that no tolerance can rescue.

The second problem is entering masses instead of percents, and this one is actually harmless. Because only proportions matter, the three steps work identically whether the numbers you enter are percents or grams: dividing by atomic weight gives relative moles either way, and dividing by the smallest gives the same ratios. So if your data comes as masses from a sample rather than percents from an analysis, enter the masses and read the same formula. The only requirement is consistency: do not mix percents for one element with grams for another, because then the proportions are meaningless.

The third problem is a wrong element symbol. Symbols are case-sensitive in chemistry, and the page’s element list follows the standard symbols: C for carbon, H for hydrogen, O for oxygen, Fe for iron, and so on. Entering the wrong symbol assigns the wrong atomic weight, which shifts that element’s moles and breaks every ratio that depends on it. If one element’s mole value looks wildly out of line with the others, check its symbol first, then its percent. If your element is not offered in the list, the page cannot compute that compound, and no workaround inside the page will fix it: the atomic weight table is part of the calculation.

The fourth problem is over-multiplying. If no small multiplier brings all ratios within 0.05 of whole numbers, the temptation is to try larger multipliers, 5, 6, 7, until something fits. Resist it: a multiplier that large usually means the inputs are wrong, not that the compound has large subscripts. Real empirical formulas rarely need multipliers above 4, and a formula that only works with a multiplier of 7 is almost certainly built on a mistyped percent. Go back to the inputs, check the sum, check the symbols, and recompute.

The fifth problem is confusing the empirical formula with the molecular formula. CH2O is not a claim that the molecule has one carbon, two hydrogens and one oxygen; it is a claim that the proportions are 1 : 2 : 1. Without a molar mass, the molecule could be CH2O, C2H4O2 or C6H12O6, and the page correctly refuses to choose between them. Enter a measured molar mass when you have one, check that the multiplier lands near a whole number, and only then read the molecular formula. Guessing a molar mass to force a molecular formula is worse than stopping at the empirical one.

Checking your formula against the evidence

A formula computed from percents is a hypothesis, and like any hypothesis it should be checked against independent evidence before it is trusted. The first check is the empirical mass. If you know roughly what the compound’s molar mass is, divide it by the empirical mass and see whether the multiplier lands near a whole number. For CH2O at 30.026 grams per mole, a measured molar mass near 180 gives a multiplier near 6, which is a clean result. A measured mass near 150 would give a multiplier near 5, which is also clean. A measured mass near 100 would give about 3.33, which is not clean, and that mismatch says either the percents or the molar mass need re-examining.

The second check is the percent sum, done before the calculation rather than after. Add the percents yourself and confirm they land near 100. A sum of 99.8 or 100.3 reflects ordinary rounding and is fine. A sum of 92 or 108 is not rounding: it is a missing element, a double-counted element, or a transcription error, and no tolerance setting will fix it. This check takes seconds and catches the largest class of input errors, which is why it belongs at the start of the workflow, not as an afterthought when the formula looks strange.

The third check is the ratio pattern itself. Real empirical formulas have small subscripts, usually 1, 2, 3 or 4, and ratios that need multipliers of 2, 3 or 4 to become whole. If your calculation produces subscripts like 7, 11 or 13, or needs a multiplier of 6 or more, treat the result as suspect even if the arithmetic is internally consistent. Either an input is wrong, or the substance is a mixture rather than a single compound, and a mixture has no single empirical formula at all. In that case the honest answer is not a formula but a note that the analysis does not describe one compound.

The fourth check is replication. Recompute the formula from the same percents by hand, or have someone else do it, and compare intermediate values, not just the final formula. The mole values are the most informative comparison point: if two calculations agree on moles but differ on the formula, the disagreement is in the multiplying step. If they differ on moles, the disagreement is in the percents or the symbols. The calculator’s display of every intermediate value exists for exactly this purpose, turning a black-box answer into a checkable chain of reasoning.

None of these checks requires equipment beyond arithmetic and attention. Together they form a habit worth building: sum the percents, follow the moles, question large subscripts, and confirm with a molar mass when one is available. A formula that passes all four checks is as trustworthy as its inputs allow, and a formula that fails any of them is telling you something useful, which is that the inputs, not the method, need another look.

One last situation deserves a note: two formulas that both fit the same percents. This happens when the percents are rounded enough that two different multiplier choices both land within tolerance, or when the analysis itself cannot distinguish two proportions that are close. In that case, do not pick the prettier formula and move on. Report both candidates, note the tolerance that lets both fit, and look for the deciding evidence: a molar mass that favours one multiplier, a second analysis with tighter percents, or a property of the substance that only one candidate explains. A calculator that shows its working, as this one does, makes that comparison possible, because you can see exactly which ratio is ambiguous and by how much. Ambiguity in the inputs should produce caution in the conclusion, not confidence in the first answer that looks tidy.

From empirical formula to molecular formula: why the multiple matters

The empirical formula is the ratio. The molecular formula needs one more number, and the ratio alone can never supply it.

The empirical formula gives the simplest whole-number ratio of the elements. The molecular formula gives the actual count in a molecule, and it is the empirical formula times a whole number, the multiplier. The multiplier is the known molar mass divided by the empirical-formula mass, rounded to the nearest whole number. For glucose, the empirical formula CH2O has mass about 30, the measured molar mass is about 180, the multiplier is 6, and the molecular formula is C6H12O6. For benzene, CH has mass about 13, the measured molar mass is about 78, the multiplier is 6, and the formula is C6H6. Without the measured molar mass there is no way to choose between CH2O, C2H4O2, and C6H12O6, and any answer that pretends otherwise is a guess. Combustion analysis gives the ratio; a separate measurement — mass spectrometry, vapour density, or another molecular-weight method — gives the mass, and only the two together give the molecular formula.

Ionic compounds have no molecular formula at all, only a formula unit, because they exist as lattices, not molecules: sodium chloride is NaCl as a ratio, and there is no NaCl molecule to count. The companion guide works the empirical-to-molecular route through glucose, benzene, and the water and nitrogen-dioxide edge cases, and gives the full worked procedure: percent to grams, grams to moles, divide by the smallest, clear fractions, and check by the molar mass.

Frequently asked questions

What is an empirical formula?

An empirical formula shows the simplest whole-number ratio of the atoms in a compound. It tells you the proportions, not the total number of atoms in one molecule.

How do you calculate an empirical formula from percent composition?

Divide each element percent by its atomic weight to get moles, divide every mole value by the smallest mole value to get ratios, then multiply all ratios by the smallest whole number that turns them into integers.

What if the ratios are not whole numbers?

Multiply all ratios by the same small number, usually 2, 3, or 4, until they are close to integers. This calculator accepts a ratio within 0.05 of an integer after multiplying, and it says so when the result is only approximate.

What is the difference between an empirical formula and a molecular formula?

The molecular formula is a whole-number multiple of the empirical formula. Enter a molar mass and this calculator finds that multiple and shows the molecular formula beside the empirical formula.

Why does the percent sum warning appear?

Percent composition should add up to 100. If your numbers add up to much more or much less, one value is probably mistyped. The calculator still shows a result, because the same math works on plain masses in grams.

Where do the atomic weights come from?

Atomic weights come from the IUPAC standard atomic weights of the elements, 2021 conventional values, the same table used by the moles and molecular weight calculators on this site.

Do I need to enter atomic weights myself?

No. Pick the element symbol and enter its percent; the calculator carries the atomic weights itself and shows the mole values it computes from them. You only need the symbols and the percents from the analysis.

Do my percents need to add up to 100?

The ratios come from the relative amounts, so the proportions matter more than the total. Still, percents from a real analysis should add to about 100, and a total far from 100 usually means a missing element or a typo, which will distort every ratio.

What if my compound has four elements?

Use the fourth element pair in Advanced options. Enter its symbol and percent there, and it joins the same three steps: moles, ratios, then multiplication to whole numbers. The fourth pair is already included in the result with its default values.

Why does the calculator sometimes say the result is approximate?

Because a ratio landed within 0.05 of a whole number after multiplying, rather than exactly on it. Published percents are usually rounded, so a ratio like 1.9959 counting as 2 is normal, and the calculator marks the result approximate instead of pretending the inputs were exact.

Can I find the molecular formula without knowing the molar mass?

No. The empirical formula gives the ratio, and the molecular formula is that ratio times a whole number. The multiplier is the measured molar mass divided by the empirical-formula mass, and without a measured molar mass — from mass spectrometry, vapour density, or another molecular-weight method — there is no way to choose between the possible multiples. Combustion analysis alone gives the ratio only.

Why do ionic compounds have no molecular formula?

Because they exist as lattices of ions, not as discrete molecules: there is no NaCl molecule to count. Sodium chloride is written NaCl as a formula unit, expressing the ratio of ions in the lattice, and that ratio is the empirical formula. The molecular formula is a concept that applies to covalent molecular substances, where molecules exist.

What if my mole ratio comes out as 1.12 instead of a whole number?

Treat it as experimental error and round to 1, checking the effect on the formula. Ratios within about 0.05 of a whole number are rounded; larger deviations, such as 1.33 or 1.5, are cleared by multiplying all subscripts, by 3 or 2 in those examples. A ratio that stays far from any whole number after clearing suggests a data error or a mixture, and should be re-checked against the original percentages before any formula is written.

Disclaimer: This is an educational chemistry tool. Atomic weights are IUPAC standard values. Results depend on the percents you enter, and rounded published percents can shift a ratio slightly. For laboratory or exam work, check the result against your source data.
↑