Tools › Learn › Molar Mass Calculator
⚗️

Molar Mass Calculator

Molar mass, percent composition and grams ⇄ moles for any chemical formula.

⚗️ Brackets & hydrates
📊 Percent composition
🔁 Grams ⇄ moles
🧬 Click-to-build table
⚗️

Enter a chemical formula

Handles brackets and hydrates. Results update as you type.

Try:
Advertisement
🧬

Periodic table

Click an element to add it to the formula. Elements in your formula are highlighted.

How to use

  1. Type a chemical formula such as H2SO4, Ca(OH)2 or CuSO4·5H2O. Capital letters start each element, and numbers go straight after an element or a bracket.
  2. The molar mass appears instantly, with each element’s atoms, atomic mass, mass and mass percent, plus the full working.
  3. Switch between IUPAC atomic weights and rounded textbook masses (H = 1, C = 12, O = 16, Cl = 35.5) to match your syllabus, and choose how many decimals to show.
  4. Use the grams ⇄ moles ⇄ particles box to convert an amount of the substance, or click elements in the periodic table to build a formula.

How to calculate molar mass

The molar mass of a compound is the sum of the atomic masses of all atoms in its formula, expressed in grams per mole. For sulfuric acid, H₂SO₄: 2 × 1.008 (H) + 1 × 32.06 (S) + 4 × 15.999 (O) = 98.072 g/mol. Brackets multiply everything inside them, so Ca(OH)₂ counts 1 Ca, 2 O and 2 H.

For a hydrate such as CuSO₄·5H₂O, the dot means the water is added to the salt: 159.602 + 5 × 18.015 = 249.677 g/mol. The calculator shows the anhydrous part and the water separately, along with the percentage of water.

Formula tips

Element symbols are case sensitive: Co is cobalt but CO is carbon monoxide. Use ( ), [ ] or { } for groups, and a dot, ·, * or . between a salt and its water of crystallisation. A number directly before a part, such as 5H2O, multiplies that part. Write ions with ^ if you need to, such as SO4^2-; the charge is ignored because an electron’s mass is negligible.

Why molar masses differ slightly between sources

Atomic weights are measured values that IUPAC revises from time to time, and some elements (like hydrogen, carbon and oxygen) vary a little in nature. This tool uses the current IUPAC conventional values, so H₂SO₄ comes out at 98.072 while older tables give 98.079. For exams, use the rounded option if your syllabus uses whole-number masses. For elements with no stable isotope, the mass number of the most stable isotope is used.

Common molar masses

Values below use IUPAC atomic weights and are rounded to three decimals.

FormulaNameMolar mass (g/mol)
H2OWater18.015
CO2Carbon dioxide44.009
NaClSodium chloride (table salt)58.440
H2SO4Sulfuric acid98.072
HClHydrochloric acid36.458
HNO3Nitric acid63.012
NaOHSodium hydroxide39.997
KOHPotassium hydroxide56.105
CaCO3Calcium carbonate100.086
NaHCO3Sodium bicarbonate (baking soda)84.006
Na2CO3Sodium carbonate105.988
C6H12O6Glucose180.156
C12H22O11Sucrose342.297
C2H5OHEthanol46.069
CH4Methane16.043
NH3Ammonia17.031
O2Oxygen gas31.998
N2Nitrogen gas28.014
H2Hydrogen gas2.016
Ca(OH)2Calcium hydroxide (slaked lime)74.092
KMnO4Potassium permanganate158.032
Fe2O3Iron(III) oxide159.687
Al2O3Aluminium oxide101.960
MgOMagnesium oxide40.304
CuSO4Copper(II) sulfate159.602
CuSO4·5H2OCopper(II) sulfate pentahydrate (blue vitriol)249.677
(NH4)2SO4Ammonium sulfate132.134
H3PO4Phosphoric acid97.994
CH3COOHAcetic acid60.052
C6H6Benzene78.114
C3H8Propane44.097
C8H18Octane114.232
KClPotassium chloride74.548
AgNO3Silver nitrate169.872
CaCl2Calcium chloride110.978
MgSO4·7H2OMagnesium sulfate heptahydrate (Epsom salt)246.466
H2O2Hydrogen peroxide34.014
CaOCalcium oxide (quicklime)56.077
NH4ClAmmonium chloride53.489
K2Cr2O7Potassium dichromate294.182
Na2SO4Sodium sulfate142.036
COCarbon monoxide28.010
SO2Sulfur dioxide64.058
NO2Nitrogen dioxide46.005
CH3OHMethanol32.042
C2H4Ethylene28.054
C2H2Acetylene26.038
Al2(SO4)3Aluminium sulfate342.131
Ca3(PO4)2Calcium phosphate310.174
FeSO4·7H2OIron(II) sulfate heptahydrate278.006
Na2S2O3Sodium thiosulfate158.097
O3Ozone47.997

Your formulas stay on your device

Everything is calculated in your browser. Nothing you type is uploaded or stored.

Frequently asked questions

How do I calculate the molar mass of a compound?

Multiply the atomic mass of each element by the number of its atoms in the formula and add the results. For H₂O: 2 × 1.008 + 15.999 = 18.015 g/mol.

What is the molar mass of water, H₂O?

18.015 g/mol (using IUPAC atomic weights), or 18 g/mol if you use rounded textbook values.

What is the difference between molar mass and molecular weight?

They have the same number. Molar mass is in grams per mole (g/mol), while molecular weight (or formula mass) is a relative value in atomic mass units (u) and has no unit when written as a ratio. For ionic compounds like NaCl, the term formula mass is more accurate than molecular mass.

How do I find the molar mass of a hydrate like CuSO₄·5H₂O?

Add the molar mass of the salt to the water multiplied by the number of water molecules: 159.602 + 5 × 18.015 = 249.677 g/mol. Enter it with a dot, a star or a full stop, for example CuSO4·5H2O or CuSO4*5H2O.

How do I convert grams to moles?

Divide the mass in grams by the molar mass: moles = grams ÷ molar mass. For 36 g of water, 36 ÷ 18.015 ≈ 2.0 mol. The converter on this page does it in either direction and also gives the number of particles using Avogadro’s number, 6.022 × 10²³.

What is mass percent composition?

It is the share of the total mass contributed by each element: (mass of the element in one mole ÷ molar mass) × 100. The table shows it for every element in your formula, which is a common exam question.

Why does the calculator say “Unknown element”?

Symbols are case sensitive and start with a capital letter. “co” and “Co” are not the same as “CO”, and “NACL” is not valid; write NaCl. The tool suggests a corrected spelling when it can.

Which atomic masses are used?

By default, the IUPAC standard (conventional) atomic weights, for example H = 1.008, C = 12.011, O = 15.999 and Cl = 35.45. The rounded option uses the whole-number values taught in many schools, such as H = 1, C = 12, O = 16, Na = 23 and Cl = 35.5.

Does it work for organic compounds and polymers?

Yes, for any formula you can type, such as C6H12O6 or C8H18. Condensed formulas like CH3COOH work too, because repeated letters are added together. It cannot read structural drawings or names such as “glucose”.

Is this molar mass calculator free?

Yes, it is free, runs in your browser and needs no sign-up.