Molar Mass Calculator

Parse a chemical formula such as H2O, NaCl, or Ca(OH)2 and calculate its molar mass from standard IUPAC atomic weights, with a full element by element breakdown.

By Marshkalk

Type a chemical formula such as H2O, NaCl, C6H12O6, Ca(OH)2, or Fe2(SO4)3. The calculator reads each element and its atom count, including grouped atoms in parentheses, and adds up the standard atomic masses to get the molar mass.

Element symbols use one capital letter and an optional lowercase letter, exactly as on the periodic table (Na, not NA or na). Use parentheses for grouped atoms, such as (OH)2 or (SO4)3.

Molar mass and relative formula mass (Mr) at GCSE and A-level

Working out the molar mass of a compound, sometimes called the relative formula mass or Mr at GCSE, is a skill needed across the whole UK Chemistry curriculum, from balancing equations to calculating yields and concentrations. The molar mass in g/mol is found by adding up the relative atomic mass of every atom in the formula, counting each element as many times as it appears, including atoms grouped inside parentheses. This tool reads a typed formula, splits it into elements and atom counts, and adds up the standard atomic weights automatically, showing the contribution of each element to the total.

Molar mass of common compounds

CompoundFormulaMolar mass (g/mol)
WaterH2O18.02
Table salt (sodium chloride)NaCl58.44
Carbon dioxideCO244.01
GlucoseC6H12O6180.16
Calcium hydroxideCa(OH)274.09
Iron(III) sulfateFe2(SO4)3399.86

What this calculator cannot do

The parser reads standard molecular formulas with nested parentheses, such as Ca(OH)2 or Fe2(SO4)3, but it does not handle hydrates written with a dot, such as CuSO4.5H2O, or ionic charges written inside the formula. It also always uses the standard atomic weight of each element, which is a natural abundance average, so it cannot give the exact mass of a compound made from a single specific isotope. For a formula with an unrecognised element symbol or unbalanced parentheses, the tool reports an error instead of a result rather than guessing.

Worked example

For Ca(OH)2, the parentheses multiply the O and H inside by 2, giving 1 Ca, 2 O, and 2 H atoms in total. Adding the atomic masses: Ca = 40.08, O x 2 = 2 x 16.00 = 32.00, H x 2 = 2 x 1.008 = 2.016, for a total molar mass of 40.08 + 32.00 + 2.016 = 74.10 g/mol. Type Ca(OH)2 above to see the same breakdown generated automatically. Once you know the molar mass of a solute, the Solution Concentration Calculator converts a mass and volume into molarity, and the Periodic Table Lookup tool gives more detail on any individual element used in a formula.