Molar Mass Calculator

Calculate the molar mass of any chemical compound from its molecular formula.

Enter Chemical Formula

Use standard chemical notation (e.g., H2O, NaCl, Ca(OH)2)

Molar Mass

18.015 g/mol
H2O - 3 atoms total

Element Breakdown

O
Oxygen
15.999 g/mol x 1
15.999 g/mol
88.81%
H
Hydrogen
1.008 g/mol x 2
2.016 g/mol
11.19%

Quick Conversions

1 mole =
18.015 g
1 gram =
0.055509 mol
Molecules/mole
6.022 x 10^23
At STP (gas)
22.4 L/mol

What Is Molar Mass?

Molar mass is the mass of one mole of a substance, expressed in grams per mole (g/mol). It is numerically equal to the molecular weight or formula weight of the compound, but expressed in different units. One mole of any substance contains exactly 6.022 × 10²³ entities (atoms, molecules, or formula units) — Avogadro's number. Molar mass bridges the gap between the atomic scale (where we count atoms) and the laboratory scale (where we measure grams).

To calculate the molar mass of a compound, you sum the atomic masses of all atoms in its chemical formula. Each element's atomic mass is found on the periodic table and represents the weighted average of its naturally occurring isotopes. For example, water (H₂O) has a molar mass of 2(1.008) + 15.999 = 18.015 g/mol, meaning one mole of water molecules weighs 18.015 grams.

This calculator parses any valid chemical formula — including those with parentheses like Ca(OH)₂ — and provides a complete element-by-element breakdown showing each atom's contribution to the total molar mass. It also displays the percentage composition by mass for each element, which is useful for empirical formula determination and quality control in manufacturing.

The Molar Mass Formula

The molar mass of a compound is the sum of the atomic masses of all atoms in the formula, each multiplied by the number of times that atom appears.

Molar Mass Calculation

M = Σ (atomic mass of element × number of atoms of element)

Where:

  • M= Molar mass of the compound (g/mol)
  • atomic mass= Standard atomic weight from the periodic table (g/mol)
  • number of atoms= Count of each element in the chemical formula

How to Use This Calculator

This calculator provides instant molar mass results from any chemical formula:

  1. Enter Chemical Formula: Type the molecular formula using standard notation — capital letters for elements, lowercase for second letters (e.g., NaCl, Ca(OH)₂, C₆H₁₂O₆).
  2. Or Select a Common Compound: Click any preset button (H₂O, NaCl, glucose, etc.) to auto-fill the formula.
  3. View Results: The calculator displays the total molar mass, element-by-element breakdown with mass contributions and percentages, and quick conversion factors.

The element breakdown table shows each element's atomic mass, the number of atoms, the total mass contribution, and the percentage by mass. The progress bars provide a visual representation of each element's contribution.

Understanding the Results

The results panel provides several useful pieces of information beyond just the molar mass:

Element Breakdown: Each element is listed with its atomic mass, count, total mass contribution, and percentage. Elements are sorted by contribution, with the heaviest contributors at the top. This breakdown is essential for quality control and for verifying that your formula is correct.

Quick Conversions: The calculator shows that 1 mole equals the molar mass in grams, and 1 gram equals 1/molar mass moles. These conversions are the basis for all stoichiometric calculations. It also notes that 1 mole contains 6.022 × 10²³ molecules and, for gases at STP, occupies 22.4 liters.

Error Detection: If the formula contains an unrecognized element symbol, the calculator reports an error. This helps catch typos like lowercase/uppercase errors (e.g., "co" instead of "Co" for cobalt).

Real-World Applications

Molar mass calculations are the foundation of stoichiometry, which is the quantitative relationship between reactants and products in chemical reactions. Every laboratory preparation, from making a simple salt solution to synthesizing a complex pharmaceutical, begins with calculating how much of each reagent is needed — and that requires molar mass.

In pharmaceutical manufacturing, molar mass determines drug dosing, formulation ratios, and quality specifications. Active pharmaceutical ingredients are weighed by mass, but their biological activity is determined by the number of molecules, which is calculated from molar mass.

In environmental monitoring, pollutant concentrations are often converted between mass-based and mole-based units using molar mass. In food science, nutritional calculations use molar mass to convert between grams of nutrients and molecules. Even in forensics, molar mass helps identify unknown substances by comparing measured molecular weights to known compounds.

Worked Examples

Water (H₂O)

Problem:

Calculate the molar mass of water.

Solution Steps:

  1. 1Identify atoms: 2 hydrogen atoms and 1 oxygen atom
  2. 2Hydrogen contribution: 2 × 1.008 = 2.016 g/mol
  3. 3Oxygen contribution: 1 × 15.999 = 15.999 g/mol
  4. 4Total molar mass = 2.016 + 15.999 = 18.015 g/mol

Result:

Molar mass of H₂O = 18.015 g/mol (11.19% H, 88.81% O)

Glucose (C₆H₁₂O₆)

Problem:

Calculate the molar mass of glucose.

Solution Steps:

  1. 1Carbon: 6 × 12.011 = 72.066 g/mol
  2. 2Hydrogen: 12 × 1.008 = 12.096 g/mol
  3. 3Oxygen: 6 × 15.999 = 95.994 g/mol
  4. 4Total = 72.066 + 12.096 + 95.994 = 180.156 g/mol

Result:

Molar mass of C₆H₁₂O₆ = 180.156 g/mol (40.00% C, 6.71% H, 53.28% O)

Calcium Hydroxide (Ca(OH)₂)

Problem:

Calculate the molar mass of calcium hydroxide with parentheses.

Solution Steps:

  1. 1Parse parentheses: (OH)₂ means 2 oxygen and 2 hydrogen atoms
  2. 2Calcium: 1 × 40.078 = 40.078 g/mol
  3. 3Oxygen: 2 × 15.999 = 31.998 g/mol
  4. 4Hydrogen: 2 × 1.008 = 2.016 g/mol
  5. 5Total = 40.078 + 31.998 + 2.016 = 74.092 g/mol

Result:

Molar mass of Ca(OH)₂ = 74.092 g/mol

Tips & Best Practices

  • Always use correct capitalization: 'Na' is sodium, 'NA' is not a valid symbol.
  • For formulas with parentheses like Ca(OH)₂, multiply all atoms inside by the subscript outside.
  • Molar mass is essential for converting between mass and moles: n = mass / M.
  • The percentage composition can help verify your formula is correct.
  • Common mistakes: confusing atomic mass (per atom) with molar mass (per mole). They have the same numerical value but different units.
  • Use the molar mass as a conversion factor: 1 mol = M grams.

Frequently Asked Questions

Molar mass and molecular weight are numerically equal but have different units. Molar mass is expressed in grams per mole (g/mol) and refers to the mass of one mole of a substance. Molecular weight is a dimensionless ratio comparing the mass of a molecule to 1/12 the mass of a carbon-12 atom. In practice, they are used interchangeably, but molar mass is the preferred term in laboratory chemistry.
For ionic compounds, use the formula weight (the sum of atomic masses of all ions in the formula unit) rather than molecular weight. For example, NaCl has a formula weight of 22.990 + 35.453 = 58.443 g/mol. The compound doesn't exist as discrete molecules, but the formula weight serves the same purpose for stoichiometric calculations.
Chemical formulas like Ca(OH)₂ use parentheses to indicate that the enclosed group appears multiple times. The calculator parses parentheses by multiplying the atomic counts inside by the subscript outside. This handles complex formulas accurately, including nested parentheses like Fe₂(SO₄)₃ for iron(III) sulfate.
The calculator uses standard atomic weights from IUPAC, which are weighted averages of naturally occurring isotopes. For most elements, these values are precise to 3-5 significant figures, which is sufficient for all practical stoichiometric calculations. The uncertainty is typically less than 0.1% for common elements.
The calculator uses average atomic weights from the periodic table, not isotope-specific masses. For isotopically pure compounds or mass spectrometry calculations, you would need to use the specific mass of each isotope. For example, using ¹²C (exactly 12.000) instead of the average carbon weight (12.011) would give different results for precise mass calculations.

Sources & References

Last updated: 2026-06-06

💡

Help us improve!

How would you rate the Molar Mass Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Chemistry: The Central Science

by Brown, LeMay, Bursten

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.