How to use the molar mass calculator
- Type a chemical formula, such as H2O, Ca(OH)2 or C6H12O6, or start typing a common name, such as glucose or sodium bicarbonate, and pick it from the list.
- Write element symbols exactly: a capital letter, then a small letter if the symbol has one. Numbers after a symbol or a bracket count atoms; a number at the start of a part multiplies the whole part.
- For a hydrate, separate the water with ·, * or a full stop. For an ion, add the charge after ^, as in NH4^+ or SO4^2-. Me, Et, Ph and Bu are read as the methyl, ethyl, phenyl and butyl groups.
- To convert, type an amount and pick its unit: grams, milligrams, kilograms, moles, millimoles or particles. The calculator gives the other two.
- Read the molar mass, the Hill formula, the mass and atom share of each element, and every step.
What molar mass is
The molar mass of a substance is the mass of one mole of it, in grams per mole. A mole is a fixed number of particles, the Avogadro constant: 6.022 140 76 × 10²³, exact since the SI was revised in 2019. Molar mass connects the mass you weigh on a balance with the number of molecules or formula units in it, which is what chemical equations count.
For a compound, the molar mass is the sum of the standard atomic weights of its atoms. Glucose, C₆H₁₂O₆, has 6 carbon, 12 hydrogen and 6 oxygen atoms, so its molar mass is 6 × 12.011 + 12 × 1.0080 + 6 × 15.999 = 180.156 g/mol. Carbon makes up 40% of its mass but only a quarter of its atoms, because hydrogen atoms are so light.
Molar mass and molecular weight have the same number. Wikipedia explains that molecular mass and formula mass “are commonly used as synonyms of molar mass, as the numerical values are identical (for all practical purposes), differing only in units”. It also notes that the equivalence “was exact before the redefinition of the mole in 2019, and is now only approximate, but equality may still be assumed with high accuracy.”
The atomic weights behind it
Atomic weights are not constants of nature like the speed of light. Most elements are mixtures of isotopes, and the mix varies a little from one natural source to another. The Commission on Isotopic Abundances and Atomic Weights, CIAAW, publishes the standard values; this calculator uses its 2024 abridged table for every element that has a standard atomic weight.
The table gives each weight to the precision the natural variation allows: hydrogen as 1.0080, oxygen as 15.999, but chlorine as 35.45 and sulfur as 32.06. A molar mass can be no more precise than its least precise atomic weight, so the calculator rounds to match. Table salt, NaCl, comes out as 58.44 g/mol, not 58.440, and water as 18.015 g/mol.
Elements with no stable isotopes, such as technetium and promethium, have no standard atomic weight, because their mass depends on which isotope you have. The calculator says so rather than guessing.
Writing formulas: brackets, hydrates and ions
A number after a bracket multiplies everything inside it. Calcium hydroxide, Ca(OH)₂, has two oxygen and two hydrogen atoms, for 74.092 g/mol. Brackets can be nested, using (), [] or {}: potassium ferrocyanide, K₄[Fe(CN)₆], has six cyanide groups, for 368.345 g/mol.
Hydrates hold water in their crystals, and its mass counts. Copper(II) sulfate pentahydrate, CuSO₄·5H₂O, has a molar mass of 249.68 g/mol, while the anhydrous salt, CuSO₄, has 159.60 g/mol. Weighing one form when a recipe means the other gives a concentration off by more than a third.
For an ion, the charge changes the mass only by the electrons gained or lost, which is negligible at this precision. The sulfate ion, SO₄²⁻, has a molar mass of 96.06 g/mol, the same as its atoms. Write the charge after ^ so the calculator can tell it from a count: SO42- could mean 42 oxygen atoms.
Organic shorthand works too. Me, Et, Ph and Bu stand for the methyl, ethyl, phenyl and butyl groups, CH₃, C₂H₅, C₆H₅ and C₄H₉, so diethyl ether can be typed Et2O (74.123 g/mol) and triphenylmethane Ph3CH (244.337 g/mol).
The Hill formula
Chemical databases list compounds by their Hill formula, so that each formula has one spelling. Carbon comes first, then hydrogen, then the other elements in alphabetical order; a compound without carbon lists all its elements alphabetically. Acetic acid, written CH₃COOH to show its structure, is C₂H₄O₂ in Hill order, and table salt is ClNa. The calculator gives the Hill formula so you can search for a compound in PubChem or another database.
Grams, moles and particles
The molar mass converts between mass and amount of substance: n = m ÷ M, and m = n × M. Multiplying the moles by the Avogadro constant gives the number of particles: N = n × Nᴀ. For example, 10 g of glucose is 0.0555074 mol, or 3.34274 × 10²² molecules, and 2 mol of water weighs 36.03 g.
The calculator also gives the mass of a single particle. One molecule of water has a mass of about 18.015 daltons, or 2.99146 × 10⁻²³ g, the molar mass divided by the Avogadro constant.
Common compounds by name
You can type the name of 60 common compounds instead of a formula, from water and table salt’s sodium chloride to caffeine, aspirin, ibuprofen and cholesterol. Each formula was checked against PubChem by its molecular formula and weight, and the calculator shows the compound’s PubChem number with the result.
Common mistakes
- Typing symbols in the wrong case: CO is carbon monoxide, Co is cobalt, and co is neither.
- Forgetting the water in a hydrate, such as weighing CuSO₄·5H₂O as if it were CuSO₄.
- Using a count after a bracket for only the last atom: in Ca(OH)₂ the 2 applies to both O and H.
- Rounding atomic weights early, such as oxygen to 16, which shifts results for large molecules.
Your values stay on your device
Everything is worked out in your browser. Nothing you type is sent anywhere or stored.
Frequently asked questions
How do you calculate molar mass?
Multiply the standard atomic weight of each element by the number of its atoms in the formula, then add the results. For water, H₂O: 2 × 1.0080 + 15.999 = 18.015 g/mol. The calculator shows each step.
Is molar mass the same as molecular weight?
In practice, yes. Molecular weight, or relative molecular mass, is a number without units, while molar mass is in grams per mole. For any compound the two have the same number: the molecular weight of water is about 18.015 and its molar mass is about 18.015 g/mol.
How do I enter a hydrate or a complex?
Separate the water of a hydrate with a dot, ·, *, or a full stop: CuSO4·5H2O or CuSO4.5H2O (249.68 g/mol). Brackets can be nested, as in K4[Fe(CN)6], and a number in front of a part multiplies it.
How do I convert grams to moles?
Divide the mass by the molar mass: n = m ÷ M. Enter the formula, type the mass in the “Convert” box and pick grams; the calculator also gives the number of particles. For example, 10 g of glucose is 0.0555074 mol.
Why does my textbook give a slightly different molar mass?
Textbooks and periodic tables round atomic weights differently, for example oxygen to 16.00 instead of 15.999. This calculator uses the CIAAW 2024 abridged standard atomic weights, the current values from the body responsible for them, and rounds the result to the precision those weights allow.
Is anything I type sent anywhere?
No. Everything is worked out in your browser and nothing you type is sent anywhere or stored.