Molar Mass Calculator

Enter a chemical formula like H2O or C6H12O6. Get the molar mass in grams per mole, calculated from atomic masses of all elements in the compound.

Updated June 2026 · How this works

How It Works
The formula, explained simply

This molar mass calculator breaks down your chemical formula into individual elements and calculates the total molecular weight. When you enter a formula like H2O or C6H12O6, the calculator identifies each element symbol and counts how many atoms of each element are present.

The calculation process multiplies the atomic mass of each element by the number of atoms of that element in the molecule. For water (H2O), this means 2 hydrogen atoms × 1.008 amu each plus 1 oxygen atom × 15.999 amu equals 18.015 g/mol. The calculator uses standard atomic masses from NIST data to ensure accuracy.

The result shows both the total molar mass and a breakdown of how each element contributes to the final value. This information helps you understand the composition and relative weights of different elements in your compound, which is crucial for stoichiometric calculations and chemical analysis.

When To Use This
Right tool, right situation

Use this molar mass calculator whenever you need to convert between grams and moles in chemical calculations. This is essential for stoichiometry problems where you must determine how much of each reactant you need or how much product you will get from a reaction.

The calculator is particularly useful for solution preparation in laboratory work. When making a 1 M solution of glucose, you need to know that glucose has a molar mass of 180.156 g/mol, so you would dissolve 180.156 grams in enough water to make exactly 1 liter of solution.

You will also need molar mass for percent composition calculations, empirical formula determinations, and ideal gas law problems. Any time you see units like g/mol, mol/g, or need to relate the mass of a substance to the number of particles it contains, molar mass is your conversion factor.

Common Mistakes
Why results sometimes look wrong

The most common error is incorrect element capitalization - chemical formulas are case-sensitive. Water must be entered as H2O, not h2o or H2o. Each element symbol starts with a capital letter followed by lowercase letters if applicable (like Cl for chlorine, not CL).

Another frequent mistake is forgetting subscripts or entering them incorrectly. The subscript number applies only to the element immediately before it. In Ca(OH)2, the 2 multiplies the entire OH group, giving you 1 calcium + 2 oxygen + 2 hydrogen atoms. Parentheses in formulas require careful attention to which atoms are being multiplied.

Double-check your formula against reliable sources before calculating. A wrong formula gives a meaningless molar mass that will throw off all subsequent calculations. If you get an unexpectedly high or low result, verify that you have entered the correct molecular formula for your compound.

The Math
Worked examples and deeper derivation

Molar mass calculation follows a simple addition formula: sum all (atomic mass × number of atoms) for each element in the compound. For a general formula AxByCz, the molar mass equals (x × atomic mass of A) + (y × atomic mass of B) + (z × atomic mass of C).

Atomic masses come from the periodic table and represent the weighted average of all isotopes of that element. The calculator uses precise values like 1.008 for hydrogen and 15.999 for oxygen. When calculating glucose (C6H12O6), you compute: 6 × 12.011 (carbon) + 12 × 1.008 (hydrogen) + 6 × 15.999 (oxygen) = 180.156 g/mol.

The final result in g/mol tells you the mass of exactly one mole (6.022 × 10²³ molecules) of your compound. This conversion factor is essential for all quantitative chemistry work, from simple stoichiometry to complex analytical procedures.

Water (H2O)
Chemical formula: H2O
The molar mass is 18.015 g/mol, calculated from 2 hydrogen atoms (2.016) plus 1 oxygen atom (15.999).
Glucose (C6H12O6)
Chemical formula: C6H12O6
The molar mass is 180.156 g/mol, from 6 carbon (72.066) + 12 hydrogen (12.096) + 6 oxygen (95.994).
Sulfuric acid (H2SO4)
Chemical formula: H2SO4
The molar mass is 98.079 g/mol, combining 2 hydrogen + 1 sulfur + 4 oxygen atoms.

Common questions

How do I calculate molar mass from a chemical formula?
Find the atomic mass of each element from the periodic table, multiply by the number of atoms of that element in the formula, then add all the values together. For example, H2O has 2 hydrogen atoms (2 × 1.008) plus 1 oxygen atom (1 × 15.999) equals 18.015 g/mol.
What is the difference between molar mass and molecular weight?
Molar mass and molecular weight are numerically the same but have different units. Molar mass is expressed in grams per mole (g/mol) while molecular weight is dimensionless. Both represent the mass of one mole of a substance.
Why is molar mass important in chemistry calculations?
Molar mass converts between grams and moles, which is essential for stoichiometry calculations. It tells you how many grams are in one mole of a compound, allowing you to calculate reactant amounts, product yields, and solution concentrations accurately.

Need something this doesn't cover?

Suggest a tool — we'll build it →