Molar Mass Calculator

Enter a chemical formula to instantly calculate its molar mass. View elemental composition and mass percentages with this free online molar mass calculator.

How to Use

  1. Enter formula

    Type the chemical formula of the substance (e.g., NaCl, C6H12O6).

  2. Calculate

    Click the Calculate button to compute the molar mass.

  3. View results

    See the molar mass (g/mol), element counts, and mass percentages.

What Is Molar Mass?

Molar mass is the mass of one mole (mol) of a substance, that is, the mass of 6.022×10²³ particles, and is expressed in g/mol. It is found by multiplying each element's atomic mass (the relative mass of a single atom) by how many times it appears in the chemical formula, then adding everything up.

Molar mass acts as the bridge between mass and the number of particles in chemistry. Dividing a measurable amount in grams (g) by the molar mass tells you how many moles of molecules take part in a reaction, making it the starting point for stoichiometric calculations, preparing solutions of a given molarity, and figuring out yields.

  • Water H₂O → 18.015 g/mol
  • Salt NaCl → 58.443 g/mol
  • Glucose C₆H₁₂O₆ → 180.156 g/mol

The Formula

Molar mass is the sum of the contributions of every element in the chemical formula.

Molar mass = Σ(atomic mass × count)

Example — Water H₂O (atomic masses H=1.008, O=15.999)

  • Hydrogen: 1.008 × 2 = 2.016 g/mol
  • Oxygen: 15.999 × 1 = 15.999 g/mol
  • Total: 2.016 + 15.999 = 18.015 g/mol

For formulas with parentheses, work out the contents first, then multiply by the number after the closing bracket. For example, Ca(OH)₂ is read as 1 Ca + (1 O + 1 H)×2. Results are shown to three decimal places.

Frequently Asked Questions

What is molar mass?
Molar mass is the mass of one mole (6.022×10²³ particles) of a substance, expressed in grams per mole (g/mol). It is found by multiplying each element's atomic mass by its count and adding the results. For example, water (H₂O) is 1.008×2 + 15.999 = 18.015 g/mol.
How do I enter a chemical formula?
Write element symbols with the first letter capitalized and the second lowercase (e.g., H, Na, Ca), and add a number after an element for its count (e.g., H2O). Parentheses are supported, with the number after them setting the group count (e.g., Ca(OH)2). Enter the formula without spaces.
What is the difference between molar mass and molecular weight?
Molecular weight is a dimensionless relative mass (in amu, atomic mass units), while molar mass carries the unit g/mol. The two are numerically identical, so water with a molecular weight of 18.015 has a molar mass of 18.015 g/mol.
How is Avogadro's number related to molar mass?
Avogadro's number (6.022×10²³) is the number of particles in one mole. In 18.015 g of water, whose molar mass is 18.015 g/mol, there are about 6.022×10²³ water molecules. In other words, molar mass is the mass of Avogadro's number of particles gathered together.
Can it calculate formulas with parentheses?
Yes. It supports nested parentheses such as Ca(OH)2 and Al2(SO4)3. The element counts inside the parentheses are multiplied by the number after them and then summed. For example, Ca(OH)2 resolves to 1 Ca, 2 O, and 2 H: 40.078 + 15.999×2 + 1.008×2 = 74.092 g/mol.
How do I find the number of moles from mass?
Moles = mass (g) ÷ molar mass (g/mol). For example, 90 g of glucose (180.156 g/mol) is 90 ÷ 180.156 ≈ 0.5 mol. Conversely, multiplying moles by molar mass gives the required mass, which is useful when preparing solutions.
How is the mass percentage (composition) calculated?
It is each element's contributing mass divided by the total molar mass. For water, oxygen makes up 15.999 ÷ 18.015 ≈ 88.8% and hydrogen 2.016 ÷ 18.015 ≈ 11.2%. The calculator shows this composition ratio alongside the count of each element.
Which atomic mass values are used?
Standard atomic weights (IUPAC values) are used. For example, H=1.008, C=12.011, N=14.007, O=15.999, Na=22.990, Cl=35.453, Ca=40.078. These values are the average masses of naturally occurring isotopes, which is why they are not whole numbers.
2026 physical constants

Related Calculators