Molar Mass Calculator

Molar mass of any chemical formula, with per-element breakdown.

Free molar mass calculator. Type any chemical formula like Ca(OH)2, (NH4)2SO4 or CuSO4.5H2O and get the molar mass in g/mol, the percent composition by mass, and a grams to moles converter. IUPAC standard atomic weights, 100% in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How is molar mass calculated from a formula?

The calculator counts how many atoms of each element the formula contains, multiplies each count by that element standard atomic weight, and adds the results. In symbols, molar mass = sum over elements of (count times atomic weight). For glucose C6H12O6 that is 6 times 12.011 plus 12 times 1.008 plus 6 times 15.999, which is about 180.16 g/mol.

The molar mass of a substance is the mass of one mole of it, expressed in grams per mole (g/mol). It is the bridge between the world you can weigh on a balance and the world of atoms and molecules you actually react together, so almost every quantitative chemistry calculation starts here. This tool parses any chemical formula you type, sums the standard atomic weights of every atom, and reports the total molar mass together with a full per-element breakdown, the percent composition by mass, and a built-in grams to moles converter. It is aimed at chemistry students, lab technicians and anyone preparing solutions or checking stoichiometry, and it runs entirely in your browser.

How it works

The calculator reads your formula from left to right with a small recursive parser. It recognises one- and two-letter element symbols (capitalisation matters, so Co is cobalt while CO is carbon monoxide), subscript counts, and nested groups in parentheses, square brackets or braces with a multiplier, for example Ca(OH)2, Al2(SO4)3 or K4[Fe(CN)6]. Hydrates written with a dot and coefficient, such as CuSO4.5H2O, are split into segments and each segment is multiplied by its coefficient. Every atom count is then multiplied by that element IUPAC 2021 conventional atomic weight and the contributions are added:

molar mass = Σ (count of element × atomic weight)

Each element percent by mass is its contribution divided by the total, times 100, and the moles-and-grams converter applies n = m ⁄ M and m = n × M, reporting the molecule count as N = n × Nₐ where Nₐ is the Avogadro constant, 6.02214076 × 10²³ mol⁻¹.

Worked example

Take glucose, C6H12O6. The formula contains 6 carbon, 12 hydrogen and 6 oxygen atoms:

  • C: 6 × 12.011 = 72.066 g/mol
  • H: 12 × 1.008 = 12.096 g/mol
  • O: 6 × 15.999 = 95.994 g/mol

Adding these gives a molar mass of 180.156 g/mol. The percent composition is therefore about 40.0 percent carbon, 6.7 percent hydrogen and 53.3 percent oxygen. If you dissolve 18.0156 g of glucose you have exactly 0.1 mol, which is roughly 6.02 × 10²² molecules.

ElementCountAtomic weightSubtotal (g/mol)% by mass
C612.01172.06640.0%
H121.00812.0966.7%
O615.99995.99453.3%
Total24180.156100%

A note on the formula

Use the symbol Σ to mean “sum of”. Molar mass is an additive quantity: because each atom contributes its own fixed atomic weight, the order of atoms in the formula never changes the answer, and isomers such as glucose and fructose, both C6H12O6, share the same molar mass even though they are different molecules. The figure you get here is a weighted average over each element natural isotope mix, which is why values like chlorine 35.45 are not whole numbers. The formula is parsed entirely in your browser and nothing leaves your device.