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
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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.
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.
Frequently asked questions.
What is the difference between molar mass and molecular weight?
What is the difference between average molar mass and monoisotopic mass?
How does the parser read formulas with parentheses like Ca(OH)2 or Al2(SO4)3?
Why are some atomic weights given as intervals in the IUPAC 2021 table?
How do I calculate the molar mass of a hydrate like CuSO4·5H2O?
How do I use molar mass to weigh out a solution of known molarity?
Does case matter in element symbols? Is Co the same as CO?
Why does the calculator give 180.156 g/mol for glucose but my textbook says 180.16 or 180.18?
What happens if I enter an unknown element symbol or an unbalanced parenthesis?
References& sources.
- [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]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]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]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]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]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