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.
| Element | Count | Atomic weight | Subtotal (g/mol) | % by mass |
|---|---|---|---|---|
| C | 6 | 12.011 | 72.066 | 40.0% |
| H | 12 | 1.008 | 12.096 | 6.7% |
| O | 6 | 15.999 | 95.994 | 53.3% |
| Total | 24 | — | 180.156 | 100% |
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.