Molar Mass Calculator

Type a chemical formula to get its molar mass, the mass percent of each element and the atom count. Handles brackets, hydrates and ion charges, and converts grams to moles and moles to grams.

Calculator Science & Engineering Updated Oct 4, 2026
How to Use
  1. Type a formula such as H2O, Ca(OH)2 or CuSO4·5H2O. Symbols are case-sensitive: Co is cobalt, CO is carbon monoxide.
  2. For a hydrate use a dot (CuSO4.5H2O or CuSO4·5H2O); for an ion add the charge with a caret, as in SO4^2- or Fe^3+.
  3. Choose Molar mass, Grams → moles or Moles → grams, and enter the mass or amount with its unit if you are converting.
  4. Read the molar mass and the composition: the bars and the table give each element’s share of the mass.
  5. Show Work lists every element’s count × atomic weight and the conversion steps.
Input
case-sensitive
m
n
Presets
Composition
Molar mass
—
Atoms per formula
—
Elements
—
Mass of one
—

Worked Example

Copper(II) sulfate pentahydrate, CuSO₄·5H₂O. Count the atoms, including the five waters: 1 Cu, 1 S, 4 + 5 = 9 O and 10 H.
Cu 1 × 63.546 = 63.546; S 1 × 32.06 = 32.060; O 9 × 15.999 = 143.991; H 10 × 1.008 = 10.080.
M = 63.546 + 32.060 + 143.991 + 10.080 = 249.677 g/mol. The water, 5 × 18.015 = 90.075 g/mol, is 36.08% of it.

Grams to moles. 25 g of the blue crystals is n = 25 ÷ 249.677 = 0.1001 mol.

The common mistake: leaving out the water of crystallisation. Using CuSO₄ alone (159.602 g/mol) gives 25 ÷ 159.602 = 0.1566 mol, 56% too many moles, and any solution made from it comes out 36% weaker than planned. The same slip happens with brackets: reading Ca(OH)₂ as CaOH₂ gives 58.093 g/mol instead of 74.092.

Show Work

Enter a formula to see the step-by-step working.

Formulas

Molar mass
M = Σ (count × atomic weight)
H₂O: 2 × 1.008 + 15.999 = 18.015 g/mol
Mass percent
%X = count × A(X) ÷ M × 100
The bars and table above
Grams to moles
n = m ÷ M
m in grams, M in g/mol
Moles to grams
m = n × M
0.5 mol × 58.44 g/mol = 29.22 g
Particles
N = n × Nᴀ
Nᴀ = 6.02214076 × 10²³ per mol (exact)
Mass of one particle
m₁ = M ÷ Nᴀ
Numerically M daltons per molecule

From Dalton’s Weights to the Mole

John Dalton published the first table of relative atomic weights in the early 1800s, taking hydrogen as 1. Amedeo Avogadro proposed in 1811 that equal volumes of gases at the same temperature and pressure hold equal numbers of molecules, but the idea was largely ignored until Stanislao Cannizzaro used it to sort out a consistent set of atomic weights, presented at the Karlsruhe Congress in 1860. Jean Perrin later named the number of particles in a mole after Avogadro.

The mole became an SI base unit in 1971, defined by the atoms in 12 g of carbon-12. Since the 2019 redefinition of the SI it is fixed by the Avogadro constant instead: exactly 6.02214076 × 10²³ particles.

The atomic weights used here are the IUPAC conventional values published by its Commission on Isotopic Abundances and Atomic Weights (CIAAW): H 1.008, C 12.011, N 14.007, O 15.999, Na 22.990, S 32.06, Cl 35.45, Fe 55.845, Cu 63.546. For elements whose isotope mix varies in nature, such as hydrogen, carbon and chlorine, IUPAC gives a range and recommends these single values for everyday work. Elements with no stable isotope (technetium, promethium, polonium and the heavier ones up to plutonium) use the mass number of their longest-lived isotope.

About This Calculator

This calculator reads a chemical formula and adds up the atomic weights to give the molar mass in g/mol. It understands nested brackets (round, square and curly), hydrates written with a dot, a charge at the end, and Unicode subscripts pasted from a document, and it says exactly how it read your formula so a misplaced capital letter shows up straight away.

Besides the molar mass it gives the number of atoms, each element’s share of the mass as bars and a table, the share of any water of crystallisation, and converts between grams, moles and number of particles. All of it runs in your browser.

It is meant for chemistry homework, lab solution preparation, stoichiometry and checking label claims. It is also reachable as the Molecular Weight Calculator.

Related tools: Molarity Calculator, Density Calculator, and Unit Converter (mass).

Frequently Asked Questions

How do you calculate molar mass?

Multiply each element’s atomic weight by the number of its atoms in the formula and add the results. For glucose, C6H12O6: 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 72.066 + 12.096 + 95.994 = 180.156 g/mol.

How do I enter brackets, hydrates and ions?

Brackets multiply everything inside: Ca(OH)2 is 74.092 g/mol. A hydrate takes a dot and a count: CuSO4·5H2O (or CuSO4.5H2O) is 249.677 g/mol. Charges go at the end, ideally after a caret: SO4^2- is 96.056 g/mol. Without a caret, Fe3+ is read as Fe³⁺ and NH4+ as NH₄⁺; the “Read as” line in Show Work tells you which was used.

How do I convert grams to moles?

Divide the mass by the molar mass: n = m ÷ M. 90 g of glucose is 90 ÷ 180.156 = 0.4996 mol. Going the other way, multiply: 0.5 mol of NaCl is 0.5 × 58.44 = 29.22 g. Multiply moles by Avogadro’s number, 6.02214076 × 10²³, to count the molecules.

Is molar mass the same as molecular weight?

They are the same number in different units. Molar mass is grams per mole (water: 18.015 g/mol); molecular weight or formula mass is the mass of one molecule in daltons (18.015 Da), which is 2.9915 × 10⁻²³ g. For ionic solids such as NaCl, “formula mass” is the better word because there are no separate molecules.

Why do other calculators give slightly different values?

They use older or more precise atomic weights. This one uses the IUPAC conventional values (Cl 35.45, S 32.06, H 1.008), so NaCl is 58.44 g/mol; older tables with Cl 35.453 and Na 22.98977 give 58.443. The difference is far below what a lab balance measures. Natural isotope mixtures also vary slightly from sample to sample, which is why IUPAC rounds some weights.

How do I use the Molar Mass Calculator?

Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.

Is it free? Does it work without internet?

Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.

Where does my data go?

Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.

Common Use Cases

Preparing solutions

0.1 mol of NaCl weighs 0.1 × 58.44 = 5.844 g; dissolve it and make up to 1 L for a 0.1 M solution.

Stoichiometry homework

10 g of CaCO3 (100.086 g/mol) is 0.09991 mol, the starting point for any reaction calculation.

Water of crystallisation

CuSO4·5H2O is 36.08% water, so heating 10 g of blue crystals leaves 6.392 g of white anhydrous powder.

Fertiliser nitrogen

Ammonium nitrate, NH4NO3 (80.043 g/mol), is 35.00% nitrogen by mass.

Medicine and nutrition

A 200 mg dose of caffeine (194.194 g/mol) is 1.030 mmol.

Last updated: