Elemental Analysis Calculator

Calculate molar mass and mass percent composition from a formula.
Pick up to four elements with atom counts, get the empirical formula and gram amounts.

Molar mass

Elemental analysis tells you what percentage of a compound’s mass comes from each element.
Every compound has a fixed mass composition determined entirely by its chemical formula.

Molar mass = Σ (number of atoms × atomic mass of that element)

Mass percent of element X = (atoms_X × M_X) / molar mass × 100

For water (H₂O): M = 2×1.008 + 1×15.999 = 18.015 g/mol %H = 2×1.008 / 18.015 × 100 = 11.19% %O = 15.999 / 18.015 × 100 = 88.81%

For glucose (C₆H₁₂O₆): M = 6×12.011 + 12×1.008 + 6×15.999 = 180.156 g/mol %C = 72.066/180.156 = 40.00%, %H = 12.096/180.156 = 6.71%, %O = 95.994/180.156 = 53.28%

The percentages always sum to 100%. Use that as a sanity check, and note the calculator prints the sum so you can see it land on 100.00 rather than having to add the rows up yourself.

The three glucose figures above add to 99.99, not 100, because each one was rounded to two decimals first. That is rounding, not an error, and it is exactly why the calculator sums the unrounded values before printing its check line.

Worked example: what these numbers buy you

Take 25 g of calcium carbonate (CaCO₃, M = 100.086 g/mol). It is 40.04% calcium by mass, so the sample holds 10.01 g of calcium. A supplement label claiming 500 mg of “calcium carbonate” per tablet is therefore delivering about 200 mg of actual calcium, which is why labels quote “elemental calcium” separately. Same arithmetic, and it is the reason the distinction exists.

Reference atomic masses used here

Element Symbol Mass (g/mol) Element Symbol Mass (g/mol)
Hydrogen H 1.008 Sulfur S 32.065
Carbon C 12.011 Chlorine Cl 35.453
Nitrogen N 14.007 Potassium K 39.098
Oxygen O 15.999 Calcium Ca 40.078
Fluorine F 18.998 Iron Fe 55.845
Sodium Na 22.990 Copper Cu 63.546
Magnesium Mg 24.305 Zinc Zn 65.380
Aluminum Al 26.982 Bromine Br 79.904
Silicon Si 28.086 Silver Ag 107.868
Phosphorus P 30.974 Iodine I 126.904

These are IUPAC standard atomic weights, which are averages over the natural isotope mix. A sample enriched in one isotope will not match them, and that is exactly what mass spectrometry measures instead.

Empirical versus molecular formula

The calculator reduces your atom counts to their smallest whole-number ratio and reports it. Glucose C₆H₁₂O₆ reduces to CH₂O, which is also the empirical formula of formaldehyde and of acetic acid. Combustion analysis alone cannot tell those three apart, because all three give the same mass percentages. You need the molar mass from a separate measurement before the molecular formula follows.

Elemental analysis is how chemists verify a newly synthesized compound is what they think it is. A combustion analyzer burns the compound and measures the CO₂ and H₂O produced to determine %C and %H; %N comes from a separate measurement. If the measured percentages match the theoretical values for the proposed formula, the synthesis was likely successful. In practice a result within 0.4 percentage points of theory on every element is the usual publication threshold, and a compound that misses on carbon but hits on hydrogen is nearly always carrying trapped solvent.

The inverse problem, given the mass percentages find the empirical formula, is also a classic exam question. Divide each percentage by the element’s atomic mass to get the mole ratios, then divide through by the smallest and reduce to whole numbers.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.