Molar Mass Calculator
Calculate the molar mass (molecular weight) of a compound by entering the number of atoms of each element. Supports H, C, N, O, Na, Cl, Ca, Fe, S, P, K, Mg. Result in g/mol.
How to use this tool
- Enter hydrogen (h), carbon (c), nitrogen (n), oxygen (o), sodium (na), chlorine (cl), calcium (ca), iron (fe), sulfur (s), phosphorus (p), potassium (k) and magnesium (mg) in the fields above.
- Results update instantly as you type — or click Calculate.
- Read your molar mass and the full breakdown beneath it.
The molar mass of a compound is the sum of the atomic masses of all its atoms, measured in g/mol. Enter the atom count for each element present. For example, water (H₂O) has 2 hydrogen + 1 oxygen = 18.015 g/mol.
Formula
Molar Mass (g/mol) = Σ (number of atoms of elementi × atomic mass of elementi)
For example, for H2O: (2 × 1.008) + (1 × 15.999) = 18.015 g/mol
Atomic masses used (IUPAC 2021): H 1.008, C 12.011, N 14.007, O 15.999, Na 22.990, Cl 35.453, Ca 40.078, Fe 55.845, S 32.065, P 30.974, K 39.098, Mg 24.305
How it works
Molar mass is calculated by multiplying the number of each type of atom in the molecule by that element's standard atomic weight and summing the results. The atomic masses used here are the IUPAC 2021 standard atomic weights rounded to four decimal places.
This method handles twelve common elements (H, C, N, O, Na, Cl, Ca, Fe, S, P, K, Mg). It does not support isotope-specific masses or elements outside this set. Results are rounded to three decimal places of g/mol.
Worked example
Worked example — water (H₂O)
- Water has 2 hydrogen atoms and 1 oxygen atom.
- Hydrogen contribution: 2 × 1.008 = 2.016 g/mol.
- Oxygen contribution: 1 × 15.999 = 15.999 g/mol.
- Total molar mass = 2.016 + 15.999 = 18.015 g/mol; total atoms = 2 + 1 = 3.
Molar mass of H2O = 18.015 g/mol; total atom count = 3.
Key terms
- Molar mass
- The mass in grams of one mole (6.022 × 1023 formula units) of a substance, numerically equal to its molecular weight in daltons.
- Atomic weight (standard atomic mass)
- The weighted average mass of an element's naturally occurring isotopes, expressed in unified atomic mass units (u) or daltons.
- Mole (mol)
- The SI unit of amount of substance; one mole contains exactly 6.02214076 × 1023 elementary entities (Avogadro's number).
- IUPAC
- International Union of Pure and Applied Chemistry — the body that publishes internationally agreed standard atomic weights used in chemistry calculations.
- Molecular formula
- A notation showing the exact number of each type of atom in one molecule of a compound, e.g., H2O or NaCl.
Frequently asked questions
- Where do atomic masses come from?
- From the IUPAC periodic table. They reflect the natural isotope distribution on Earth, which is why carbon is 12.011 rather than exactly 12.
- What are some common molar masses?
- Water H₂O = 18.015, NaCl = 58.44, glucose C₆H₁₂O₆ = 180.16, CO₂ = 44.01 g/mol.