⚗️ Molar Mass Calculator

Type a chemical formula to get its molar mass in g/mol, the percent composition by element, and grams ↔ moles — with parentheses and hydrates.

✓ Free✓ No Signup Required✓ Browser-Based

Case matters: Co is cobalt, CO is carbon monoxide. Use ( ) or [ ] for groups and · or . for hydrates.

Molar mass of C6H12O6
180.156 g/mol
Hill formula: C6H12O6
ElementAtomsAtomic weightMass (g/mol)% by mass
C Carbon612.01172.06640.00%
H Hydrogen121.00812.0966.71%
O Oxygen615.99995.99453.28%

Grams ↔ moles

= 0.055507 mol = 3.3427e+22 formula units

= 90.0780 g

What Molar Mass Calculator Does

This molar mass calculator reads a chemical formula as you type it — including parentheses, square brackets and hydrates such as CuSO4·5H2O — and returns the molar mass in grams per mole, a breakdown by element with percent composition, and a converter between grams, moles and number of formula units.

Atomic weights are the IUPAC standard values shown to three decimal places (H 1.008, C 12.011, O 15.999), the same precision used in most textbooks and answer keys. Elements with no stable isotopes, such as technetium or radon, have no standard atomic weight; for those the mass number of the longest-lived isotope is used and shown in brackets.

How to Use Molar Mass Calculator

  1. Type a chemical formula, or tap an example
  2. Read the molar mass in g/mol and the Hill-order formula
  3. Check each element’s contribution and percent by mass
  4. Convert between grams and moles below the result

Formula Used by Molar Mass Calculator

Molar mass

M = Σ (atoms of each element × its atomic weight)

Worked example

Glucose, C6H12O6.

  1. C: 6 × 12.011 = 72.066
  2. H: 12 × 1.008 = 12.096
  3. O: 6 × 15.999 = 95.994
  4. 72.066 + 12.096 + 95.994

Result: 180.156 g/mol — 40.00% C, 6.71% H, 53.28% O by mass.

Grams, moles and particles

moles = grams ÷ M · particles = moles × Nₐ

Nₐ
Avogadro constant, exactly 6.02214076 × 10²³ per mole

Worked example

10 g of glucose.

  1. 10 ÷ 180.156 = 0.05551 mol
  2. 0.05551 × 6.02214076 × 10²³

Result: 0.0555 mol, or about 3.343 × 10²² molecules.

Molar Masses of Common Compounds

CompoundFormulaMolar mass (g/mol)
WaterH₂O18.015
AmmoniaNH₃17.031
Carbon dioxideCO₂44.009
EthanolC₂H₅OH46.069
Sodium chlorideNaCl58.440
Calcium hydroxideCa(OH)₂74.092
Sodium bicarbonateNaHCO₃84.006
Sulfuric acidH₂SO₄98.072
Calcium carbonateCaCO₃100.086
GlucoseC₆H₁₂O₆180.156
CaffeineC₈H₁₀N₄O₂194.194
Copper(II) sulfate pentahydrateCuSO₄·5H₂O249.677

Source: CIAAW — Standard Atomic Weights

How to Read Your Result

Why your textbook may differ slightly

Some books round atomic weights to two decimals or fewer (H 1.01, O 16.00), which moves the answer in the second decimal place. Water comes out as 18.02 instead of 18.015. Use the precision your course asks for; the element table shows the weights used so you can match them.

Hydrates

The water in a hydrate is part of the solid’s mass, so it counts. Anhydrous copper sulfate, CuSO₄, is 159.604 g/mol; the blue pentahydrate is 249.677 g/mol, about 36% water by mass.

Limitations & Accuracy Notes

  • Ionic charges written at the end of a formula (SO4^2-) are ignored; the mass of the electrons is negligible for this purpose.
  • Isotope-specific formulas (such as D₂O written with D) are not supported; use the element symbol H and correct separately if needed.
  • Standard atomic weights apply to normal terrestrial materials; isotopically enriched samples differ.

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 them up. For water, H₂O: 2 × 1.008 + 15.999 = 18.015 g/mol. The same number in grams is one mole of the substance.
What is the difference between molar mass and molecular weight?
Numerically they are the same. Molecular weight (or molecular mass) is expressed in atomic mass units (u or Da) for one molecule; molar mass is in grams per mole for 6.02214076 × 10²³ of them. 18.015 u per water molecule means 18.015 g/mol.
How do I enter parentheses and hydrates?
Type them as written: Ca(OH)2, Al2(SO4)3, K4[Fe(CN)6]. For hydrates, join the parts with a dot, · or *: CuSO4·5H2O or CuSO4.5H2O. A number at the start of a part multiplies that whole part.
How do I convert grams to moles?
Divide the mass in grams by the molar mass: 10 g of glucose (180.156 g/mol) is 10 ÷ 180.156 = 0.0555 mol. To go from moles to grams, multiply. Both conversions are under the result.
What is percent composition?
The share of a compound’s mass that comes from each element. Glucose, C₆H₁₂O₆, is 40.00% carbon, 6.71% hydrogen and 53.29% oxygen by mass. It is the starting point for empirical-formula problems.
Why does capitalization matter?
Because element symbols are case-sensitive: Co is cobalt, but CO is carbon monoxide (one carbon, one oxygen). Every symbol starts with a capital letter, and a second letter, if any, is lowercase.
Which atomic weights are used?
IUPAC standard atomic weights, shown to three decimal places — for example H 1.008, C 12.011, O 15.999, Cl 35.45. Elements with no stable isotopes, such as technetium, use the mass number of their longest-lived isotope, shown in brackets.

References & Further Reading

By OnlineToolHubs Team • September 2026