What is molar mass?
The phrase molar mass calculator is searched about 4,400 times a month in the United States by students meeting the mole for the first time, teachers checking problem sets, and lab staff who need a formula mass they can trust before weighing anything out. The calculation itself is simple — count atoms, multiply by atomic weights, add — but it sits underneath almost everything else in quantitative chemistry: converting grams to moles, preparing solutions of a known molarity, working out percent composition, and checking whether a reaction yield makes sense. This guide explains the calculation thoroughly enough that you can predict the calculator's answer before you read it, including the awkward cases — brackets, nested groups and hydrates — where hand calculations most often go wrong.
Why does the mole need a mass at all? Because reactions happen between numbers of particles, and particles cannot be counted out one by one. The mole is the counting unit — exactly 6.02214076 x 10 to the power 23 particles, the Avogadro constant — and the molar mass is the bridge between that count and a balance. Weigh out 18.015 g of water and you have, to the precision chemistry needs, exactly one mole of water molecules. Every conversion between the laboratory world of grams and the reaction world of moles passes through the molar mass, which is why getting it right matters more than its simple arithmetic suggests.
Molar mass, molecular weight and formula mass
Three names for one idea cause real confusion, so it is worth being precise. Molecular weight is the oldest term: the sum of the atomic weights in a molecule, traditionally reported as a relative number in atomic mass units (amu). A water molecule has a molecular mass of 18.015 amu. Molar mass takes the same number and gives it practical units: 18.015 g/mol, the mass of a mole of water molecules. The numerical equality is not a coincidence — the mole and the atomic mass unit are both defined against carbon-12, so the mass of one atom in amu and the mass of one mole of those atoms in grams are the same figure.
Formula mass exists because not everything is a molecule. Sodium chloride is a lattice of ions, not a collection of NaCl molecules, so "molecular weight of NaCl" is technically a misnomer; the formula NaCl states a 1:1 ratio, and its formula mass — 22.990 + 35.45 = 58.44 — is the mass per mole of formula units. The calculator on this page handles molecules and ionic formulas identically, because the arithmetic is identical: parse the formula, count the atoms, weight them, add. When this guide says molar mass, it means that sum in g/mol, whatever the substance.
How to calculate molar mass step by step
How to calculate molar mass is the question behind most visits to this page, so here is the complete procedure, using glucose as the running example. Glucose has the formula C6H12O6. Step 1: count the atoms. The subscripts say 6 carbon, 12 hydrogen and 6 oxygen atoms. Where there is no subscript, the count is 1. Step 2: look up the atomic weights. Carbon is 12.011, hydrogen is 1.008 and oxygen is 15.999. Step 3: multiply each weight by its count. Carbon: 6 x 12.011 = 72.066. Hydrogen: 12 x 1.008 = 12.096. Oxygen: 6 x 15.999 = 95.994. Step 4: add the contributions. 72.066 + 12.096 + 95.994 = 180.156 g/mol. That is the whole method, and it is exactly what the calculator does — the per-element breakdown table in the results is these four steps written out.
Two habits make hand calculations reliable. First, write the count for every element explicitly before touching a calculator, especially in bracketed formulas, because most errors are counting errors rather than arithmetic errors. Second, keep full precision until the final sum and round only at the end: rounding each contribution to two decimals as you go can drift the total by a few hundredths, which matters when a result is compared against a syllabus value. The calculator follows the same discipline — it sums unrounded contributions and rounds only for display, and says so in the results note.
Worked examples you can check
Four examples anchor this page, each verified by hand from the atomic weights in the table further down. Example 1 — water. H2O: 2 x 1.008 + 15.999 = 18.015 g/mol. Example 2 — table salt. NaCl: 22.990 + 35.45 = 58.44 g/mol. Example 3 — sulfuric acid. H2SO4: 2 x 1.008 + 32.06 + 4 x 15.999 = 2.016 + 32.06 + 63.996 = 98.072 g/mol. Example 4 — a bracketed formula. Ca(OH)2: the bracket doubles both the oxygen and the hydrogen, giving 40.078 + 2 x 15.999 + 2 x 1.008 = 40.078 + 31.998 + 2.016 = 74.092 g/mol. Type any of these formulas into the calculator and the breakdown table reproduces each line of the working.
| Compound | Formula | Working | Molar mass (g/mol) |
|---|---|---|---|
| Water | H2O | 2 x 1.008 + 15.999 | 18.015 |
| Sodium chloride | NaCl | 22.990 + 35.45 | 58.44 |
| Glucose | C6H12O6 | 6 x 12.011 + 12 x 1.008 + 6 x 15.999 | 180.156 |
| Sulfuric acid | H2SO4 | 2 x 1.008 + 32.06 + 4 x 15.999 | 98.072 |
| Calcium hydroxide | Ca(OH)2 | 40.078 + 2 x 15.999 + 2 x 1.008 | 74.092 |
| Copper(II) sulfate pentahydrate | CuSO4·5H2O | 63.546 + 32.06 + 4 x 15.999 + 5 x 18.015 | 249.677 |
| Sucrose | C12H22O11 | 12 x 12.011 + 22 x 1.008 + 11 x 15.999 | 342.297 |
| Calcium phosphate | Ca3(PO4)2 | 3 x 40.078 + 2 x 30.974 + 8 x 15.999 | 310.174 |
A note on the hydrate row: 249.677 g/mol is the exact sum with the atomic weights used on this page, and it is commonly rounded to 249.68 g/mol. Tables built from slightly different atomic weights occasionally print 249.69 g/mol for the same compound. All three figures describe the same substance; the difference is rounding in the source weights, not an error in anyone's arithmetic — the rounding section below covers this properly.
Brackets, groups and nested formulas
Brackets are where molar mass calculations earn their reputation for trickiness, and the rule is a single one: a number after a closing bracket multiplies everything inside that bracket. In Ca(OH)2, the hydroxide group (OH) appears twice, so the formula holds 1 calcium, 2 oxygen and 2 hydrogen atoms. In Al2(SO4)3, the sulfate group (SO4) appears three times: 2 aluminium, 3 sulfur and 12 oxygen atoms, giving 2 x 26.982 + 3 x 32.06 + 12 x 15.999 = 53.964 + 96.18 + 191.988 = 342.132 g/mol. The safe hand method is to expand the formula into a flat atom count first — write out Ca1 O2 H2 — and only then multiply by atomic weights.
Formulas can nest. Potassium ferrocyanide, K4[Fe(CN)6], has a bracket inside a bracket: the inner (CN) is multiplied by 6, and the whole [Fe(CN)6] group is multiplied by 1 (no number follows the square bracket), while the leading K4 stands outside. Expanding from the inside out gives K4, Fe1, C6, N6, and the molar mass is 4 x 39.098 + 55.845 + 6 x 12.011 + 6 x 14.007 = 156.392 + 55.845 + 72.066 + 84.042 = 368.345 g/mol. Square brackets and curly braces behave exactly like round brackets — they exist in printed formulas to keep nested groups readable. This calculator's parser handles all three, nested to any depth, and expands them in the same inside-out order.
Capitalisation is part of the notation, not decoration. Co is cobalt, a single element with atomic weight 58.933; CO is carbon monoxide, carbon plus oxygen, 12.011 + 15.999 = 28.010 g/mol. Likewise, No is nobelium while NO is nitrogen plus oxygen. A parser — human or software — reads a capital letter as the start of a new element symbol, so a formula typed in the wrong case is a different formula, not the same one written casually. The calculator rejects symbols that do not exist and says which one it could not recognise, rather than guessing.
Hydrates and the dot notation
Many salts crystallise with a fixed number of water molecules locked into each formula unit, and those waters are part of the molar mass. The convention writes them after a dot: CuSO4·5H2O is copper(II) sulfate pentahydrate, the familiar blue crystals. The number before H2O multiplies the whole water molecule, so the expansion is Cu1 S1 O4 from the sulfate part plus H10 O5 from the five waters — 9 oxygen atoms in total, not 4. The sum is 63.546 + 32.06 + 63.996 + 5 x 18.015 = 63.546 + 32.06 + 63.996 + 90.075 = 249.677 g/mol, against 159.602 g/mol for the anhydrous salt CuSO4 alone. Using the anhydrous figure for the blue hydrate is one of the most common real-world molar mass errors, and it throws a prepared solution off by more than a third.
On this page the hydrate separator can be typed three ways — the middle dot in CuSO4·5H2O, a full stop in CuSO4.5H2O, or an asterisk in CuSO4*5H2O — because keyboards and textbooks differ. A leading number on any part multiplies that whole part, so the same machinery also handles formulas written with a coefficient. What the notation does not allow is a trailing dot with nothing after it, or a dot inside an element symbol; the calculator rejects both with an explanation rather than silently dropping part of the formula.
Atomic weights used by this calculator
The table below lists the elements that appear in this guide's examples, with the exact atomic weights the calculator uses — the IUPAC standard atomic weights, CIAAW 2021 conventional values. The calculator's internal table covers all 118 elements, not just these; this extract is printed so every worked figure in the guide can be checked by hand. A standard atomic weight is the average atomic mass of an element as it occurs naturally, averaged over its isotopes — which is why carbon is 12.011 rather than exactly 12: about 1% of natural carbon is carbon-13.
| Symbol | Element | Atomic weight | Symbol | Element | Atomic weight |
|---|---|---|---|---|---|
| H | Hydrogen | 1.008 | K | Potassium | 39.098 |
| C | Carbon | 12.011 | Ca | Calcium | 40.078 |
| N | Nitrogen | 14.007 | Fe | Iron | 55.845 |
| O | Oxygen | 15.999 | Cu | Copper | 63.546 |
| Na | Sodium | 22.990 | Zn | Zinc | 65.38 |
| Mg | Magnesium | 24.305 | Br | Bromine | 79.904 |
| Al | Aluminium | 26.982 | Ag | Silver | 107.87 |
| Si | Silicon | 28.085 | I | Iodine | 126.90 |
| P | Phosphorus | 30.974 | Ba | Barium | 137.33 |
| S | Sulfur | 32.06 | Au | Gold | 196.97 |
| Cl | Chlorine | 35.45 | Hg | Mercury | 200.59 |
| Pb | Lead | 207.2 | U | Uranium | 238.03 |
Honesty about the source and its limits: standard atomic weights are conventional values. For a dozen elements IUPAC publishes an interval rather than a single number, because the isotopic mix varies slightly between natural sources; the conventional value inside that interval is what tables print and what this calculator uses. A handful of elements — technetium, promethium and most elements beyond uranium — have no standard atomic weight at all, because they have no stable natural isotopes; for those, the calculator uses the mass number of the longest-lived isotope, the bracketed figure printed in standard periodic tables. If your course or protocol specifies its own atomic weight table, its values govern your assessed work, and small differences in the last decimal place against this page are expected.
Percent composition
Divide one element's contribution by the total molar mass and you have its percent composition — the share of the compound's mass that the element accounts for. In glucose, carbon contributes 72.066 of the 180.156 g/mol total, which is 40.0%; hydrogen contributes 12.096, or 6.7%; oxygen contributes 95.994, or 53.3%. The percentages always sum to 100%, which makes them a built-in check on the breakdown: if a hand calculation's percentages do not total 100 (allowing for rounding), an atom has been miscounted somewhere. The calculator prints the percentage for every element in its breakdown table, computed from the unrounded contributions.
Percent composition is also the bridge to empirical formulas: a compound analysed as 40.0% carbon, 6.7% hydrogen and 53.3% oxygen divides down, through the atomic weights, to the atom ratio 1:2:1 and the empirical formula CH2O — of which glucose, C6H12O6, is the sixfold molecular multiple. That reverse journey, from percentages back to a formula, starts from exactly the per-element figures this page displays.
Converting between grams and moles
The molar mass earns its keep as a conversion factor. Grams to moles: divide the mass by the molar mass. 36.03 g of water ÷ 18.015 g/mol = 2.00 mol. Moles to grams: multiply. 0.5 mol of glucose x 180.156 g/mol = 90.078 g. The optional mass field in the workbench performs the first conversion live: type a mass and the results show the moles alongside the molar mass, using the formula you have just calculated rather than a value you must look up and retype.
This is also where molar mass meets the rest of solution chemistry. Molarity — moles per litre of finished solution — cannot be prepared from a balance without it: a 1 mol/L glucose solution needs 180.156 g dissolved and made up to a litre, a figure that comes straight from this page's calculation. The companion Molarity Calculator on this site takes the molar mass you find here as its central input, which is why the two tools sit side by side in the Math category.
Common molar mass mistakes
The most common mistake is miscounting bracketed groups: reading Ca(OH)2 as one oxygen and one hydrogen, or applying the bracket number to only the atom before it. Expanding the formula to a flat count first prevents it. Second is case errors — Co read as CO, or a formula typed in all lowercase, which no parser can rescue because lowercase letters alone are not element symbols. Third is forgetting hydrate waters, or counting their oxygen twice: in CuSO4·5H2O the sulfate's four oxygens and the waters' five oxygens are all real, nine in total.
Fourth is rounding too early: rounding each atomic weight to a whole number gives glucose as 180 g/mol, which is fine for an estimate but not for work that will be compared to a three-decimal answer. Fifth is using the mass number instead of the atomic weight — iron is 55.845, not 56, and chlorine is 35.45, not 35 or 37, because the atomic weight averages the isotopes. Finally, beware empirical versus molecular formulas: CH2O and C6H12O6 describe related but different things, with molar masses of 30.026 and 180.156 g/mol; the calculator can only work from the formula it is given.
What this calculator cannot do
Plainly stated: this calculator does formula arithmetic only. It parses the formula you type, counts its atoms and weights them with standard atomic weights. It does not know what substance you actually hold: it cannot tell whether your powder is the hydrate or the anhydrous form, whether it is pure, or whether the formula you typed is the formula of the compound you meant. A correctly parsed formula with a wrong subscript — H2O2 typed for H2O — returns a perfectly accurate molar mass for the wrong substance, 34.014 instead of 18.015 g/mol.
It follows that this page gives no safety, handling or disposal guidance and is not a substitute for a safety data sheet or a supervisor's instructions when you work with the real substance. It also does not balance equations, predict reaction products, or judge whether a formula corresponds to a compound that can exist — charge balance and chemical plausibility are outside its scope. Used inside its stated scope, though, every figure it prints can be reproduced by hand from the atomic weight table in this guide, and the breakdown table shows its working in full.
Sources & References
- IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW) — Atomic Weights (the standard atomic weights used by this calculator)
- PubChem, US National Center for Biotechnology Information — PubChem (compound records with molecular weights for cross-checking)
- Royal Society of Chemistry — Periodic Table (interactive periodic table with an atomic weight for every element)
- NIST Chemistry WebBook, US National Institute of Standards and Technology — NIST Chemistry WebBook (standard reference data for chemical compounds)
- LibreTexts Chemistry — Formula Mass and the Mole Concept (formula mass, the mole and molar mass calculations)
- Khan Academy — Mole Conversions (converting between grams, moles and molar mass)
- ChemCollective — ChemCollective (virtual laboratory and stoichiometry resources for practising mole calculations)
Verification note: six of the seven sources above returned HTTP 200 to a direct check before publication. The Royal Society of Chemistry periodic table refuses automated checks (it returned HTTP 403 to a direct request), so that page was verified instead by retrieving and reading its full content; no source had to be substituted. The atomic weights, the formula-parsing rules and every worked figure in this guide were checked against the sources above, and the worked examples were recomputed by hand from the atomic weight table printed in this guide — 18.015 for H2O, 58.44 for NaCl, 180.156 for glucose, 74.092 for Ca(OH)2, 98.072 for H2SO4 and 249.677 for CuSO4·5H2O — so you can reproduce each one exactly in the calculator.