Chemistry

Chemical Formula Mass, Composition & Amount Calculator

Parse a common-element chemical formula, then calculate formula mass, atom count, sample amount and one element’s mass fraction.

How the calculation works

Representative formula molar mass = formula_molar_mass(chemical_formula) g/mol. Atoms per formula unit = formula_atoms(chemical_formula) atoms. Sample amount = mass/formula_molar_mass(chemical_formula) mol. Formula units in sample = mass/formula_molar_mass(chemical_formula)*6.02214076e23 units. Selected element mass fraction = formula_element_fraction(chemical_formula,element)*100 %.

Worked example

Example inputs — Formula with integer subscripts, groups or hydrate dots: H2O; Pure sample mass (g): 36.03; Element symbol for mass fraction: H. Expected results — Representative formula molar mass: 18.015 g/mol; Atoms per formula unit: 3 atoms; Sample amount: 2 mol; Formula units in sample: 1.204428152e+24 units; Selected element mass fraction: 11.19067444 %.

Assumptions and limits

Educational equilibrium/quantity model with the stated concentration and standard-state conventions. Actual mixtures can depart from ideal behaviour; these calculations are not mixing procedures or purity certificates. Uses a limited table of common rounded representative atomic weights. Supports integer subscripts, ()/[] and hydrates such as CuSO4·5H2O; unknown elements, charges, isotope notation and reaction coefficients are rejected. Natural isotopic variability is not propagated.

Reference and further reading

Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.

Related calculators

Browse all 1000 calculators →

Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.