Use this free molar mass calculator, also known as a molecular weight calculator, to find the molar mass of any chemical formula in grams per mole. Type a formula such as H2O, NaCl, C6H12O6, Ca(OH)2 or CuSO4·5H2O and you get the molar mass in g/mol, the mass percent of every element with a share bar, the working shown step by step, and the Hill formula. Add a sample in grams or moles to see the amount in moles, the mass and the number of molecules. Brackets, nested brackets and hydrates all work. Tables list the molar mass of common compounds and the atomic masses of the elements 1 to 92. It is free and instant, and your formulas stay in your browser.
What is molar mass?
The molar mass of a substance is the mass of one mole of it, in grams per mole (g/mol). One mole is 6.022 × 10²³ particles (Avogadro's number), so the molar mass links the mass you weigh on a balance to the number of particles you have. For an element it equals the atomic mass from the periodic table. For a compound you add up the atomic masses of all the atoms in its formula. Molecular weight is the same number, so this is also a molecular weight calculator.
How to calculate molar mass
- Write down the formula and count the atoms of each element.
- Multiply each atomic mass by the number of atoms.
- Add the results together.
2 × 1.008 + 32.06 + 4 × 15.999 = 98.072 g/molOther examples: water (H₂O) is 18.015 g/mol, table salt (NaCl) is 58.44 g/mol, glucose (C₆H₁₂O₆) is 180.156 g/mol and calcium hydroxide, Ca(OH)₂, is 74.092 g/mol. The calculator shows this working under every answer, so you can check each step.
Molar mass, molecular weight and formula mass
The three names give the same number. Molar mass is written in g/mol. Molecular weight (relative molecular mass) is measured in unified atomic mass units, u, which are also called amu or daltons (Da), and many textbooks write it with no unit. Formula mass is the name used for ionic salts such as NaCl, which are not made of separate molecules. For water all three are about 18.015.
How to type a formula
- Write element symbols with a capital letter first, then a lowercase letter if there is one.
Cois cobalt, butCOis carbon monoxide. - Write the number of atoms straight after the symbol:
H2SO4. - Use brackets for groups, and a number after the bracket multiplies the whole group:
Ca(OH)2,Al2(SO4)3. Square brackets work too, as inK4[Fe(CN)6]. - For a hydrate, separate the parts with a dot, a middle dot or a star:
CuSO4·5H2Ois copper sulfate pentahydrate at 249.677 g/mol, made of 159.602 g/mol of CuSO₄ and 5 × 18.015 = 90.075 g/mol of water. - Leave charges out. An ion has almost the same mass as its atoms, because an electron weighs very little.
The molar mass of an element
For a single element the molar mass is its atomic mass in g/mol: carbon is 12.011, hydrogen 1.008 and oxygen 15.999. Gases such as hydrogen, oxygen and nitrogen exist as two-atom molecules, so write them as H2, O2 and N2, which gives 2.016, 31.998 and 28.014 g/mol. The table of the elements on this page lists the values for elements 1 to 92, and you can click a symbol to open it in the calculator.
From grams to moles to molecules
Once you know the molar mass, moles = mass ÷ molar mass, and mass = moles × molar mass. Enter a sample mass or an amount in moles to see the other one and the number of molecules, which is the moles times 6.022 × 10²³. For instance, 36.03 g of water is 36.03 ÷ 18.015 = 2 moles, or about 1.204 × 10²⁴ molecules. The table also gives the mass percent of each element, which is the share of the total mass that comes from it: hydrogen makes up 11.19% of water. To turn moles and volume into a concentration, use the Molarity Calculator.
Which atomic masses are used?
The calculator uses the abridged standard atomic weights for elements 1 to 92, hydrogen to uranium, rounded the way most textbooks do. They are averages over the isotopes found in nature, not the mass of one isotope. Elements with no stable isotope, such as technetium and promethium, are shown with the mass number of a long-lived isotope. Your course may round slightly differently, which can change the last digit, so use the table your course gives you for graded work.

