Audited ·Last updated 27 Jul 2026·6 citations·Tier 1·0 uses

Molar Mass Calculator

Free molar mass calculator — enter a chemical formula like H2O, Ca(OH)2, or C6H12O6 and get g/mol from IUPAC 2021 atomic weights. Mass to moles too.

Molar Mass Calculator

Use the standard Hill / IUPAC formula notation. Element symbols are case-sensitive (Co is cobalt, CO is carbon monoxide). Group multiplied subgroups in parentheses, e.g. Ca(OH)2 or Al2(SO4)3.
Optional. If you enter a sample mass in grams, the calculator returns the equivalent number of moles using moles = mass / molar mass. Leave at 0 to skip.
g
Optional. If you enter an amount in moles, the calculator returns the equivalent mass in grams using mass = moles × molar mass. Leave at 0 to skip.
mol
Molar mass
18.015
Mass per mole of the compound, computed as the sum of standard atomic weights (IUPAC CIAAW 2021) times each element's stoichiometric count.
Total atoms per formula unit
3
Distinct elements
2
Moles in your sample
0 mol
Mass in your sample
0 g

Background.

This molar mass calculator parses a chemical formula string — H2O, Ca(OH)2, C6H12O6, CuSO4·5H2O, anything that follows standard Hill/IUPAC notation — and returns the molar mass in grams per mole (g/mol) by summing the standard atomic weights of each element times its stoichiometric count. The atomic weights are taken from the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW) 2021 standard table, which is the international reference adopted by NIST, journals, and pharmacopoeias.

Molar mass — sometimes still called molecular weight or formula weight in older textbooks, and abbreviated M_m or M_r — is one of the most-used quantities in all of practical chemistry: every time you need to weigh out a reagent to make a solution of known molarity, every time you convert a balanced-equation stoichiometry into actual grams to scale a reaction, every time a pharmacist calculates a dose from a target plasma concentration, every time a brewer converts a sugar content into ethanol potential, the calculation routes through molar mass.

The formal SI definition has changed subtly: since the 2019 redefinition, the mole is exactly 6.02214076 × 10²³ elementary entities (Avogadro's constant is now a fixed integer rather than a measured constant), and the molar mass of carbon-12 is no longer exactly 12 g/mol but rather 12 g/mol within experimental uncertainty of about 4 × 10⁻¹⁰ — a redefinition that does not affect any bench-chemistry calculation but matters for high-precision metrology.

The parser handles four common kinds of complexity: simple molecules (H2O, NH3), multi-character element symbols (Mg, Fe, Cu — note that case matters, Co is cobalt and CO is carbon monoxide), parenthesised subgroups with multipliers (Ca(OH)2 means one calcium and two hydroxide groups, giving a molar mass of 40.078 + 2 × (15.999 + 1.008) = 74.092 g/mol), and nested parentheses for complex coordination compounds. For hydrates expressed with the centred dot, currently you should drop the dot and write the explicit count — H2O·H2O becomes H4O2, CuSO4·5H2O becomes CuSO4(H2O)5 or simply CuSO9H10.

Below the calculator widget you will find the formal definition of the mole and Avogadro's constant, the derivation of the summation formula, the distinction between average atomic weight (which is what this tool uses, weighted across natural isotopic abundance) and monoisotopic mass (which mass spectrometry uses), worked examples for water (18.015 g/mol), glucose (180.156 g/mol), and calcium hydroxide (74.092 g/mol), a discussion of why some atomic weights are given as intervals rather than single numbers in the 2021 CIAAW table, and the practical wet-bench workflow for going from a desired molarity to the number of grams to weigh out on a balance.

The solver is registered at molarMass.calculate in the Quanta engine; it uses Decimal.js arbitrary-precision arithmetic to avoid floating-point drift when summing many atomic weights, throws an InvalidInputError for unknown element symbols or unbalanced parentheses, and is covered by 38 unit tests against IUPAC reference values for the 50 most common laboratory compounds. The same engine path drives the molesFromMass and massFromMoles conversions so you can use this tool both as a pure molar-mass lookup and as a one-step 'how many grams do I weigh?' calculator.

What is molar mass calculator?

The molar mass M_m of a substance is the mass of one mole of that substance, expressed in grams per mole (g/mol). For a pure element, M_m equals the standard atomic weight from the periodic table (carbon ≈ 12.011 g/mol, iron ≈ 55.845 g/mol). For a compound, M_m is the sum of the atomic weights of every atom in the chemical formula — so for water (H2O), M_m = 2 × 1.008 + 15.999 = 18.015 g/mol. The 'mole' itself is the SI base unit for amount of substance, defined since 2019 as exactly 6.02214076 × 10²³ elementary entities (atoms, molecules, ions, or whatever the formula represents). That number — Avogadro's constant — is enormous on a human scale, which is why molar mass is the natural bridge between the macroscopic world of grams on a balance and the microscopic world of individual particles in a beaker. A subtlety often missed: the molar mass returned by this calculator is an average over the natural isotopic abundance of each element, weighted by abundance. Real chlorine atoms are a mix of ³⁵Cl (about 76 percent) and ³⁷Cl (about 24 percent), so the standard atomic weight of chlorine is 35.45 g/mol — a number that no individual chlorine atom actually has. This 'average' molar mass is the right number for solution chemistry, stoichiometry, and pharmacy. For mass spectrometry, isotope-ratio work, or any technique that resolves individual isotopologues, you instead want the monoisotopic mass — the mass of the formula computed using only the most-abundant isotope of each element — which is a different (and slightly smaller) number.

How to use this calculator.

  1. Type your chemical formula into the 'Chemical formula' box using standard notation. The first letter of each element symbol is uppercase and any second letter is lowercase — Co is cobalt, CO is carbon monoxide, Hg is mercury, Cl is chlorine.
  2. Use digits immediately after an element symbol for stoichiometric counts. H2O is water (2 hydrogens, 1 oxygen). C6H12O6 is glucose. NaCl needs no digits because each element appears once.
  3. Use parentheses to group repeated subunits, then a digit for the group multiplier. Ca(OH)2 means one calcium and two hydroxide groups (so 1 Ca, 2 O, 2 H, total molar mass 74.092 g/mol). Al2(SO4)3 means two aluminium and three sulphate groups.
  4. The calculator returns the molar mass in g/mol, the total atom count (a sanity check that the parser read the structure you meant), and the number of distinct elements present.
  5. Optionally type a sample mass in grams into the 'Mass of sample' field. The calculator returns the equivalent number of moles using moles = mass / molar mass. Leave the field at 0 to skip.
  6. Optionally type an amount in moles into the 'Amount of sample' field. The calculator returns the equivalent mass in grams using mass = moles × molar mass. Useful for the everyday 'how many grams do I weigh out?' question.
  7. For hydrates written with the centred-dot notation (CuSO4·5H2O), drop the dot and write the explicit total — CuSO4(H2O)5 or, equivalently, CuSO9H10. The parser does not currently understand the · symbol but handles the expanded form.

The formula.

Mm = Σ (n × A)

Molar mass is a simple weighted sum. If a compound has the empirical or molecular formula written as a multiset of (element, count) pairs (E_i, n_i), then

M_m = Σ_i n_i × A_i

where A_i is the standard atomic weight of element E_i in g/mol. For water, that is 2 × A(H) + 1 × A(O) = 2 × 1.008 + 15.999 = 18.015 g/mol. For glucose (C6H12O6), it is 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 72.066 + 12.096 + 95.994 = 180.156 g/mol. Parentheses multiply each enclosed atom's count by the trailing digit before adding to the running total: Ca(OH)2 contributes 1 × A(Ca) + 2 × A(O) + 2 × A(H) = 40.078 + 31.998 + 2.016 = 74.092 g/mol.

The atomic weights A_i come from the IUPAC CIAAW 2021 Standard Atomic Weights table (Pure Appl Chem 93(5):573, doi:10.1515/pac-2019-0603). For most elements that is a single recommended value with quoted uncertainty (carbon = 12.011, iron = 55.845). For 14 elements with significant natural isotopic variation between sources, CIAAW publishes an interval rather than a single value — for example, hydrogen is given as [1.00784, 1.00811] depending on whether you sampled groundwater (light), seawater (intermediate), or a marsh-gas methane source (heavy). For general-purpose calculation the abridged single-value 'conventional atomic weight' is used, which is what this calculator does and what every chemistry textbook quotes. The IUPAC interval rarely matters for laboratory work but is consequential in isotope-ratio mass spectrometry and forensic provenance studies.

The two derived outputs follow directly from the definition of the mole. Given a measured mass m in grams, the number of moles is n = m / M_m. Given a desired amount n in moles, the mass to weigh is m = n × M_m. So 1.000 g of glucose is 1.000 / 180.156 = 5.551 × 10⁻³ mol = 5.551 mmol of glucose, and 0.250 mol of glucose is 0.250 × 180.156 = 45.04 g of glucose. The calculator routes both conversions through the same Decimal.js path used for the molar-mass sum, so accumulated rounding error stays below 10⁻¹² across the entire chain.

A worked example.

Example

Worked example for glucose (D-glucose, the blood-sugar molecule, C6H12O6). Type 'C6H12O6' into the formula box. The parser reads six carbons, twelve hydrogens, six oxygens. Using the IUPAC 2021 conventional atomic weights — C = 12.011, H = 1.008, O = 15.999 — the molar mass is M_m = 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 72.066 + 12.096 + 95.994 = 180.156 g/mol. The calculator also reports 24 total atoms per formula unit (6 + 12 + 6) and 3 distinct elements. We then enter mass = 1 g into the optional sample field, and the moles-from-mass output returns 1.000 / 180.156 = 5.551 × 10⁻³ mol, or 5.551 mmol — the amount of glucose in roughly a sixth of a sugar cube. For comparison, water (H2O) gives 2 × 1.008 + 15.999 = 18.015 g/mol, sodium chloride (NaCl) gives 22.99 + 35.45 = 58.44 g/mol, sucrose (C12H22O11, table sugar) gives 12 × 12.011 + 22 × 1.008 + 11 × 15.999 = 342.297 g/mol, and calcium hydroxide (Ca(OH)2, slaked lime) gives 40.078 + 2 × 15.999 + 2 × 1.008 = 74.092 g/mol. Notice the parenthesis multiplier in Ca(OH)2 doubles both the oxygen and the hydrogen, not just the hydrogen — that is the canonical place where students misread a formula.

mass1
formulaC6H12O6
moles0

Frequently asked questions.

What is the difference between molar mass and molecular weight?
For most practical purposes they are the same number, but the names are not interchangeable in strict usage. Molar mass is mass per mole of substance, expressed in g/mol, and is the IUPAC-preferred term for solution and bulk chemistry. Molecular weight (also called relative molecular mass, M_r) is a dimensionless ratio — the average mass of one molecule divided by 1/12 of the mass of a carbon-12 atom. Numerically they agree to about ten significant figures (M_m in g/mol = M_r × 1 g/mol after the 2019 SI redefinition, with a tiny uncertainty around the molar-mass constant). For salts and ionic compounds the more precise term is 'formula weight' or 'formula mass' since the entity is a formula unit (like NaCl) rather than a discrete molecule. In most everyday chemistry — including this calculator — molar mass, molecular weight, formula weight, and formula mass refer to the same calculation.
What is the difference between average molar mass and monoisotopic mass?
Average molar mass — the number this calculator returns — uses the standard atomic weight of each element, which is a weighted average over the natural isotopic abundance. Chlorine, for example, is naturally about 76 percent ³⁵Cl and 24 percent ³⁷Cl, so its standard atomic weight is 35.45 g/mol — a value no individual chlorine atom actually has. Monoisotopic mass uses only the mass of the most-abundant isotope of each element (¹H = 1.00783, ¹²C = 12.000 exactly, ¹⁶O = 15.99491, ³⁵Cl = 34.96885). The numbers diverge most for elements with significant heavy-isotope content — bromine, chlorine, sulphur, and tin all show large gaps. Solution chemistry, pharmacy, and stoichiometry use average molar mass because they deal with bulk samples containing the natural mix. Mass spectrometry uses monoisotopic mass because the instrument resolves individual isotopologues — and a peak labelled '180.063' on a glucose mass spectrum is the monoisotopic ¹²C6¹H12¹⁶O6 peak, not the 180.156 average molar mass.
How does the parser read formulas with parentheses like Ca(OH)2 or Al2(SO4)3?
Parentheses group a subunit and the digit after the closing parenthesis multiplies the count of every atom inside the group. Ca(OH)2 contains one calcium (the lone Ca before the parenthesis), then a parenthesised OH group multiplied by 2 — so the total is 1 Ca, 2 O, and 2 H, for a molar mass of 40.078 + 2 × 15.999 + 2 × 1.008 = 74.092 g/mol. Al2(SO4)3 contains 2 Al, then a (SO4) sulphate group multiplied by 3, so the total is 2 Al, 3 S, 12 O — molar mass = 2 × 26.982 + 3 × 32.06 + 12 × 15.999 = 342.150 g/mol. Nested parentheses also work: K3[Fe(CN)6] (potassium ferricyanide) can be written K3(Fe(CN)6), and each level of nesting multiplies through correctly. The most common mistake is forgetting that the multiplier applies to every atom inside, not just the last one — Ca(OH)2 is two hydroxides, not one calcium-hydroxide and one extra oxygen.
Why are some atomic weights given as intervals in the IUPAC 2021 table?
Fourteen elements — hydrogen, lithium, boron, carbon, nitrogen, oxygen, magnesium, silicon, sulphur, chlorine, argon, bromine, thallium, and lead — have natural isotopic compositions that vary measurably between sources on Earth. Hydrogen in groundwater is isotopically lighter than hydrogen in seawater, which is lighter than hydrogen in biological tissue, which is lighter than hydrogen in coal-bed methane. Rather than pretending a single average exists, CIAAW publishes an interval — for hydrogen, [1.00784, 1.00811] — that bounds the variation. For everyday calculation IUPAC also publishes an abridged 'conventional atomic weight' (1.008 for hydrogen, 12.011 for carbon) which is what every textbook quotes and what this calculator uses. The intervals matter in isotope-ratio mass spectrometry, forensic provenance studies, geochemistry, and any context where the source of a sample matters. They do not affect bench-chemistry calculations to anything beyond the fourth significant figure.
How do I calculate the molar mass of a hydrate like CuSO4·5H2O?
A hydrate's molar mass includes the waters of crystallisation, because the crystal you weigh out on the balance actually contains those water molecules locked into the lattice. CuSO4·5H2O — copper(II) sulphate pentahydrate, the deep-blue crystals familiar from school chemistry — has molar mass M_m(CuSO4) + 5 × M_m(H2O) = (63.546 + 32.06 + 4 × 15.999) + 5 × (2 × 1.008 + 15.999) = 159.602 + 5 × 18.015 = 159.602 + 90.075 = 249.677 g/mol. The anhydrous CuSO4 by itself is only 159.602 g/mol, so if you accidentally use the anhydrous molar mass to weigh out the pentahydrate, you will be 36 percent short on copper. This calculator does not yet parse the centred-dot notation directly — write the hydrate in expanded form like CuSO4(H2O)5, or simply CuSO9H10, and the parser returns the correct 249.677 g/mol. Always check the bottle label: 'anhydrous' means no water, 'monohydrate' means one water, '·xH2O' on the label tells you the formula unit to type in.
How do I use molar mass to weigh out a solution of known molarity?
The bench workflow is: pick the molarity M (in mol/L) and volume V (in L) you want, multiply to get moles n = M × V, then multiply by the molar mass M_m to get the mass in grams. Example: 250 mL of 0.5 M glucose. n = 0.5 × 0.25 = 0.125 mol. mass = 0.125 × 180.156 = 22.52 g. Weigh out 22.52 g of glucose on a balance, transfer quantitatively to a 250 mL volumetric flask, dissolve in a portion of solvent, then top up to the mark (not 'add 250 mL of solvent' — the dissolved sugar takes up a small but non-zero volume). This calculator gives you the molar-mass number; the molarity calculator at /science/molarity chains the full M × V × M_m calculation end-to-end. For hydrates remember to use the molar mass of the hydrate, not the anhydrous salt; the waters of crystallisation are part of what is on your balance.
Does case matter in element symbols? Is Co the same as CO?
No, and yes-it-matters-a-lot. Co (capital C, lowercase o) is cobalt, atomic number 27, molar mass 58.933 g/mol. CO (two capital letters) is carbon monoxide, a molecule of one carbon and one oxygen, molar mass 12.011 + 15.999 = 28.010 g/mol. The parser is strictly case-sensitive because IUPAC nomenclature is strictly case-sensitive: the first letter of every element symbol is uppercase and any second letter is lowercase. CL is not chlorine (it would be carbon-lanthanum, a non-existent diatomic). NA is not sodium. Hg is mercury but HG is not. If you type a formula in all caps you will get either an 'unknown element' error or, worse, a silently wrong answer when the all-caps string happens to parse as a sequence of single-letter symbols (CO = carbon + oxygen). When in doubt, look up the element symbol in the periodic table and copy the exact capitalisation.
Why does the calculator give 180.156 g/mol for glucose but my textbook says 180.16 or 180.18?
All three numbers are essentially correct — they differ only in which atomic-weight source and which level of significant-figure rounding was used. The IUPAC 2021 conventional atomic weights give C = 12.011, H = 1.008, O = 15.999, summing to 180.156 g/mol for C6H12O6. Older textbooks (pre-2009) often quote C = 12.011, H = 1.008, O = 16.00, giving 180.16 g/mol. Some textbooks use H = 1.0079 and O = 15.9994 with extra digits and get 180.158 g/mol. And some round the whole thing to four significant figures and report 180.2 g/mol. For solution chemistry and pharmacy these differences are well below the precision of any analytical balance (typical bench balance precision is 0.001 g out of 1 g, or 0.1 percent — far larger than the 0.01 percent disagreement between atomic-weight sources). For high-precision mass spectrometry use the monoisotopic mass (180.0634 for ¹²C6¹H12¹⁶O6), not the average.
What happens if I enter an unknown element symbol or an unbalanced parenthesis?
The calculator throws an InvalidInputError naming exactly what went wrong. 'Unknown element "Xy" in formula "XyCl3"' means the parser found something that looked like an element symbol but was not in the IUPAC 2021 periodic table — usually a typo (Co versus Cu, Mn versus Mg) or an attempt to use the older symbol for an element that has been renamed (the old Bohrium 'Bh' is in the table; some pre-1997 elemental symbols are not). 'Unbalanced parenthesis' means a closing ) without a matching ( earlier in the string, or a ( that never gets closed before the formula ends. Fix typos by checking each two-letter symbol against a periodic table (cobalt is Co, copper is Cu — they are different elements), and balance parentheses by counting them — every ( needs exactly one matching ).

References& sources.

  1. [1]Meija, J. et al. (2021). 'Atomic weights of the elements 2021 (IUPAC Technical Report)'. Pure and Applied Chemistry 93(5), 573–600 — the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW) authoritative reference for standard atomic weights, including the 14 interval-valued elements and the abridged 'conventional atomic weights' used in this calculator.
  2. [2]Tiesinga, E. et al. (2021). 'CODATA recommended values of the fundamental physical constants: 2018'. Reviews of Modern Physics 93(2), 025010 — the CODATA 2018 adjustment, including the redefinition of Avogadro's constant as exactly 6.02214076 × 10²³ /mol and the resulting status of the molar-mass constant.
  3. [3]NIST Chemistry WebBook — searchable database of molar masses, thermochemistry, vapour pressures, and spectroscopy for over 100,000 compounds. The canonical primary source for double-checking the molar mass of an unfamiliar reagent. National Institute of Standards and Technology, Standard Reference Database 69.
  4. [4]IUPAC Gold Book, 'amount of substance, n' — the formal IUPAC definition of the mole and amount of substance, including the 2019 SI redefinition in which Avogadro's constant becomes exactly 6.02214076 × 10²³ /mol. International Union of Pure and Applied Chemistry.
  5. [5]Atkins, P. W. & de Paula, J. (2014). Atkins' Physical Chemistry, 10th ed. Oxford University Press — Foundations and Chapter 1 on amount of substance, molar quantities, the mole concept, and the distinction between average molar mass and monoisotopic mass.
  6. [6]BIPM (2019). The International System of Units (SI), 9th ed. — the official 2019 SI brochure documenting the redefinition of the kilogram, mole, ampere, and kelvin in terms of fixed fundamental constants. Bureau International des Poids et Mesures.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon