Molar Mass Calculator
Find the molar mass of any compound from up to six elements and their atom counts.
Supports all 118 elements with standard atomic weights.
Updated August 23, 2026
Introduction
The molar mass of a substance is the mass of exactly one mole of that substance, expressed in grams per mole (g/mol). It is one of the most fundamental quantities in chemistry — you need it to convert between mass and amount of substance, to prepare solutions of a known concentration, and to stoichiometrically relate reactants and products.
This calculator lets you build a chemical compound by selecting up to six elements and their atom counts. It instantly shows the chemical formula, the total molar mass, and a per-element breakdown with mass percentages.
Who is this for? Students working through stoichiometry homework, lab technicians preparing reagent solutions, and anyone who needs a quick, reliable molar mass figure without looking up each atomic weight by hand.
How to use
Pick the first element from the Atom dropdown — for example, Oxygen (O).
Set the Quantity — the number of atoms of that element in the formula. For water (H₂O) you would set Hydrogen to 2 and Oxygen to 1.
A new Element section appears automatically. Add more elements as needed (up to six different entries).
Read the result: the chemical formula, the molar mass in g/mol, and a table showing each element's contribution and percentage.
Worked example — table salt (NaCl)
- Select Sodium (Na) as the 1st Element, quantity 1.
- Select Chlorine (Cl) as the 2nd Element, quantity 1.
The result shows Na at 39.3% and Cl at 60.7% of the total mass.
Calculation method
The molar mass of a compound is the sum of the atomic masses of all atoms in its formula, each multiplied by the number of times that atom appears:
Where:
- — molar mass of the compound (g/mol)
- — number of atoms of element i
- — atomic mass of element i in g/mol
The atomic masses used here are the standard atomic weights published by IUPAC (International Union of Pure and Applied Chemistry). These values are weighted averages that account for the natural isotopic distribution of each element on Earth.
Note on isotopes: Because standard atomic weights are averages, the molar mass you calculate here represents the average mass per mole for naturally occurring elemental samples. If you need the molar mass of a specific isotope (e.g., Carbon-12 exactly 12.000 g/mol), you would use that isotope's exact mass instead.
The mass percentage of each element in the compound is then:
Real-world examples
Water — H₂O
The most universal solvent. Two hydrogen atoms and one oxygen atom.
This value is essential for converting between the mass of a water sample and the number of moles — for instance, to calculate the molality of a solution.
Glucose — C₆H₁₂O₆
The primary energy source for cells. Six carbon, twelve hydrogen, and six oxygen atoms.
In biochemistry, this molar mass is used daily to prepare glucose solutions of known molarity for cell culture and clinical diagnostics.
Calcium carbonate — CaCO₃
Found in limestone, chalk, and eggshells. One calcium, one carbon, and three oxygen atoms.
Geologists and environmental scientists use this value when calculating the carbonate hardness of water or the calcium content of mineral samples.
Tips & best practices
Check your formula first
Before using the calculator, write down the chemical formula and count the atoms of each element. A common mistake is miscounting subscripts — for example, writing H₃O instead of H₃O⁺ (hydronium) or forgetting parentheses in formulas like Ca(OH)₂.
Use mass percentages to verify
After calculating, the percentage column should always sum to approximately 100%. If it doesn't, double-check that you selected the right elements and quantities — this is a quick built-in sanity check.
Same element, multiple entries are fine
You can select the same element in more than one slot. The calculator will add up the contributions from each entry — useful when you want to track different parts of a complex formula separately.
Remember the units
The result is always in g/mol. To convert moles to grams, multiply the number of moles by the molar mass. To convert grams to moles, divide the mass in grams by the molar mass.
Limitations
- •Up to six element entries can be added at once. Compounds with more than six distinct elements cannot be fully entered in a single calculation.
- •The calculator uses standard atomic weights (IUPAC recommended values). These are weighted averages over natural isotopic abundances and may differ slightly from the exact mass of a specific isotope.
- •Each element can be assigned a quantity between 1 and 16 atoms. For very large molecular formulas (e.g., polymers), you may need to simplify or calculate the repeating unit separately.
- •This tool calculates the molar mass of neutral compounds only. For ions (e.g., SO₄²⁻), the molar mass is the same as the neutral formula — the charge does not affect the mass because electron mass is negligible.
Frequently asked questions
What are the units of molar mass?
The SI unit is kg/mol, but g/mol is almost universally used in chemistry. This calculator returns values in g/mol.
How is molar mass different from molecular weight?
They are numerically equal but have different units. Molecular weight is expressed in daltons (Da) or unified atomic mass units (u) and refers to the mass of a single molecule. Molar mass is expressed in g/mol and refers to the mass of one mole (6.022 × 10²³ particles) of the substance.
What if my compound has a polyatomic ion like sulfate (SO₄²⁻)?
Just enter the atoms as they appear in the formula: Sulfur with quantity 1, Oxygen with quantity 4. The electric charge does not change the mass — electrons are far too light to affect the calculation at this precision.
Can I use this for hydrates like CuSO₄·5H₂O?
Yes. Treat the dot as addition: enter Copper (1), Sulfur (1), Oxygen (4 + 5 = 9), and Hydrogen (5 × 2 = 10). Alternatively, use six slots to enter the anhydrous salt and the water molecules separately.
Why do the mass percentages not quite add up to 100%?
Rounding of displayed values can cause the percentages to sum to 99.9% or 100.1%. The underlying calculation uses full precision — the small discrepancy is purely a display artifact.
Related Calculators
Percentage of a Percentage Calculator
Calculate cumulative percentages by multiplying two percentages together
Atom Calculator
Calculate atomic properties including protons, neutrons, electrons, atomic number and mass number
Electron Configuration Calculator
Get the electron configuration for any element from the periodic table. View atomic number, atomic mass, and valence electrons.
Atomic Mass Calculator
Calculate atomic mass from protons and neutrons. Get atomic mass in various units including atomic mass units (u), kilograms, and more.
Electronegativity Calculator
Calculate electronegativity difference between two elements and determine bond type (ionic, polar covalent, or nonpolar covalent).
Average Atomic Mass Calculator
Calculate the average atomic mass of an element based on the isotopes and their natural abundances.