Blucalculator Open Tool

Molar Mass Calculator

Enter any chemical formula to get the molar mass in g/mol, plus element-by-element composition breakdown.

Case-sensitive: H not h. Supports parentheses: Ca(OH)₂, Fe₂(SO₄)₃

Common Formulas

Embed This Calculator

Copy the code and paste it into any webpage to embed this calculator.

WordPress users: add a Custom HTML block (not the Embed block) and paste the code there.

More embed options

Free to use. A small "Powered by Blucalculator" credit is appreciated but not required.

How to use this calculator

One input: the chemical formula.

Type the formula using standard chemical notation. The calculator reads element symbols, subscripts, parentheses, and hydrate dot notation. It returns the molar mass in g/mol with a full breakdown of each element’s contribution.

Input formats the calculator handles:

  • Simple compounds: H2O, NaCl, CO2, HCl, NH3
  • Compounds with parentheses: Ca(OH)2, Al2(SO4)3, Fe2(SO4)3
  • Organic molecules: C6H12O6, C2H5OH, CH3COOH, C12H22O11
  • Hydrates: CuSO4·5H2O, Na2CO3·10H2O, MgSO4·7H2O
  • Complex inorganics: K2Cr2O7, KMnO4, Na2S2O3·5H2O
Quick example: Calcium hydroxide Ca(OH)₂

The calculator parses the formula as:

  • Ca: 1 atom × 40.078 g/mol = 40.078
  • O: 2 atoms × 15.999 g/mol = 31.998 (the subscript 2 after the closing bracket doubles both O and H)
  • H: 2 atoms × 1.008 g/mol = 2.016
  • Total molar mass: 74.092 g/mol

Without the parenthesis rule, a manual calculation might use only 1 O and 2 H, giving 58.093 g/mol. That’s a 27% error before the calculation even starts.

What molar mass actually is

Molar mass is the mass of one mole of a substance, expressed in grams per mole (g/mol).

One mole is 6.022 × 10²³ units. That number is Avogadro’s constant. It’s the count of atoms in exactly 12 grams of carbon-12. The choice is arbitrary in one sense, but it makes molar mass numerically equal to atomic mass, which is the convenient property that makes the whole system work.

Carbon has an atomic mass of 12.011 atomic mass units (amu). Its molar mass is 12.011 g/mol. The number is the same, the units are different, and the scale is different by a factor of Avogadro’s number.

This equivalence means the periodic table doubles as a molar mass table. Look up an element, read its atomic mass, append “g/mol,” and you have the molar mass for one mole of that element.

For compounds, you add up the molar masses of every atom in the formula. The complexity is in parsing the formula correctly when it contains parentheses, subscripts, or hydrate notation.

The formula

Molar Mass = Σ (Atomic Mass of Element × Number of Atoms in Formula)

For H₂O: M = (1.008 × 2) + (15.999 × 1) = 18.015 g/mol For CO₂: M = (12.011 × 1) + (15.999 × 2) = 44.009 g/mol For Ca(OH)₂: M = (40.078 × 1) + (15.999 × 2) + (1.008 × 2) = 74.092 g/mol

The Greek sigma (Σ) means “sum of.” Add up the (atomic mass × atom count) term for every element in the formula. The total is the molar mass.

Step-by-step parsing: how formulas are read

Understanding how the calculator parses formulas helps you enter them correctly and catch errors in your own manual calculations.

Simple subscripts

H₂O: the subscript 2 applies only to the immediately preceding element, hydrogen. So: 2 H atoms, 1 O atom.

CO₂: 1 C atom, 2 O atoms.

Parentheses and subscripts together

Ca(OH)₂: the subscript 2 is outside the closing parenthesis. It multiplies every atom inside the brackets by 2.

Inside the brackets: 1 O, 1 H. After applying the subscript 2: 2 O, 2 H. Plus the Ca: 1 Ca, 2 O, 2 H.

Ca(OH)₂ breakdown: Ca: 1 × 40.078 = 40.078 O: 2 × 15.999 = 31.998 H: 2 × 1.008 = 2.016 Total: 74.092 g/mol

More complex parentheses: Al₂(SO₄)₃

The subscript 3 outside the bracket multiplies everything inside. Inside the bracket: 1 S, 4 O. After multiplying: 3 S, 12 O. Plus the prefix: 2 Al.

Al₂(SO₄)₃ breakdown: Al: 2 × 26.982 = 53.964 S: 3 × 32.065 = 96.195 O: 12 × 15.999 = 191.988 Total: 342.147 g/mol

Hydrate dot notation

CuSO₄·5H₂O: the dot separates the main compound from the water of crystallisation. The 5 before H₂O means 5 water molecules per formula unit.

CuSO₄·5H₂O breakdown: Cu: 1 × 63.546 = 63.546 S: 1 × 32.065 = 32.065 O (from SO₄): 4 × 15.999 = 63.996 O (from 5H₂O): 5 × 15.999 = 79.995 H (from 5H₂O): 10 × 1.008 = 10.080 Total: 249.682 g/mol

The anhydrous CuSO₄ has a molar mass of 159.607 g/mol. The pentahydrate adds 90.075 g/mol (5 × 18.015). Getting this wrong by using the anhydrous value introduces a 56% error in every mole calculation that follows.

Molar masses of common compounds

Element-by-element breakdowns for 15 compounds you’ll encounter frequently:

Compound Formula Molar mass (g/mol) Key elements
WaterH₂O18.015H×2 + O×1
Carbon dioxideCO₂44.009C×1 + O×2
Table saltNaCl58.443Na×1 + Cl×1
AmmoniaNH₃17.031N×1 + H×3
GlucoseC₆H₁₂O₆180.156C×6 + H×12 + O×6
Sulfuric acidH₂SO₄98.072H×2 + S×1 + O×4
Sodium hydroxideNaOH39.997Na×1 + O×1 + H×1
Calcium carbonateCaCO₃100.086Ca×1 + C×1 + O×3
Hydrochloric acidHCl36.461H×1 + Cl×1
EthanolC₂H₅OH46.068C×2 + H×6 + O×1
Potassium permanganateKMnO₄158.034K×1 + Mn×1 + O×4
Iron(III) oxideFe₂O₃159.687Fe×2 + O×3
Phosphoric acidH₃PO₄97.994H×3 + P×1 + O×4
SucroseC₁₂H₂₂O₁₁342.297C×12 + H×22 + O×11
Copper sulfate (pentahydrate)CuSO₄·5H₂O249.682Cu+S+4O + 5×(2H+O)

Elemental composition percentages

The molar mass breakdown also gives you the mass percentage of each element in the compound. This is the elemental composition, and it’s used in analytical chemistry to verify unknown compounds.

For water (H₂O, molar mass 18.015 g/mol):

% H = (2.016 ÷ 18.015) × 100 = 11.19% % O = (15.999 ÷ 18.015) × 100 = 88.81%

For glucose (C₆H₁₂O₆, molar mass 180.156 g/mol):

% C = (72.066 ÷ 180.156) × 100 = 40.00% % H = (12.096 ÷ 180.156) × 100 = 6.71% % O = (95.994 ÷ 180.156) × 100 = 53.29%

Combustion analysis burns an organic compound and measures the carbon dioxide and water produced. From the masses of CO₂ and H₂O, you calculate the carbon and hydrogen percentages. The oxygen percentage comes by difference (100% minus everything else). Then you compare those percentages to candidate formulas. Molar mass drives the entire comparison.

Where molar mass shows up in real calculations

Solution preparation

You need 500 mL of 0.5M KMnO₄ solution for a titration.

Moles needed = 0.5 mol/L × 0.5 L = 0.25 mol

Molar mass of KMnO₄: K = 39.098 × 1 = 39.098 Mn = 54.938 × 1 = 54.938 O = 15.999 × 4 = 63.996 Total = 158.032 g/mol

Mass to weigh = 0.25 mol × 158.032 g/mol = 39.508 g

Weigh out 39.51 g of KMnO₄, dissolve in approximately 400 mL of distilled water, then make up to exactly 500 mL in a volumetric flask.

Every step depends on the molar mass being correct. A 5% error in molar mass gives a solution that’s 5% off in concentration, which propagates into every titration result using that solution.

Stoichiometry

Balanced equations work in mole ratios. To find how many grams of one substance react with a given mass of another, you need molar masses for both.

Reaction: CaCO₃ + 2HCl → CaCl₂ + H₂O + CO₂

How much CO₂ (g) is produced from 10 g of CaCO₃?

Molar mass of CaCO₃ = 100.086 g/mol Moles of CaCO₃ = 10 ÷ 100.086 = 0.0999 mol

From the equation: 1 mol CaCO₃ produces 1 mol CO₂ Moles of CO₂ = 0.0999 mol

Molar mass of CO₂ = 44.009 g/mol Mass of CO₂ = 0.0999 × 44.009 = 4.397 g

Percent yield

% yield = (actual mass produced ÷ theoretical mass) × 100

Theoretical mass = moles expected × molar mass of product

If the theoretical yield is calculated with the wrong molar mass, your percent yield is wrong. A 10% error in molar mass gives a 10% error in theoretical yield, which makes an actually acceptable reaction (90% yield) appear either better or worse than it is.

Why atomic masses aren’t round numbers

Carbon’s atomic mass is 12.011, not 12. Chlorine is 35.45, not 35 or 37. These aren’t rounding errors or measurement uncertainty. They’re weighted averages of naturally occurring isotopes.

Chlorine in nature is always a mixture of ³⁵Cl (75.77% of all chlorine atoms, mass 34.969) and ³⁷Cl (24.23%, mass 36.966).

Weighted average atomic mass of Cl: = (34.969 × 0.7577) + (36.966 × 0.2423) = 26.496 + 8.957 = 35.453 g/mol

Every bottle of sodium chloride you buy contains this natural chlorine mixture. So does every HCl solution, every chlorine gas reaction, and every NaCl dissolved in water. Using 35.453 for chlorine is correct because that’s what you actually have.

If you’re using isotopically pure ³⁵Cl (like in some NMR experiments or nuclear applications), the molar mass would be based on 34.969 instead. But for all normal chemistry, the standard atomic weight is what applies.

Common entry errors

Case sensitivity. H is hydrogen. h is not recognised. Co is cobalt. CO is carbon monoxide (one carbon, one oxygen). Cu is copper. CU would be read as carbon and uranium if the parser is case-sensitive. Element symbols are always one uppercase letter, sometimes followed by one lowercase letter. Getting the case wrong changes the element.

Forgetting subscripts. H₂SO₄ without the subscripts becomes HSO (if you type HSO4 correctly it works; if you type HSOOOO instead you’ve made four separate oxygen atoms, which actually gives the same result, but it’s a bad habit). The most common omission is forgetting the subscript after hydrogen: HO instead of H₂O.

Missing the hydrate notation. CuSO4 and CuSO4·5H2O have molar masses of 159.607 and 249.682 g/mol respectively. If your sample is the blue pentahydrate crystals and you enter the anhydrous formula, you’re off by 56%.

Copying formulas from unreliable sources. Wikipedia is generally reliable for chemical formulas. Random homework websites aren’t. Verify against a chemical database (PubChem, ChemSpider, or your course textbook) if you’re unsure.

Co vs CO: Cobalt (Co, atomic mass 58.933) vs carbon monoxide (CO, molar mass 28.010). A typo changes your compound entirely. For cobalt compounds, double-check that the "o" in "Co" is lowercase.

Standard atomic weights vs monoisotopic masses

For mass spectrometry, the molar masses from this calculator are wrong by design.

Mass spectrometry separates molecules by exact mass. Each molecule ionised in the mass spectrometer is a single molecular entity with a specific, exact mass based on which isotopes of each element it contains. The most common isotope combination is the monoisotopic mass.

Element Standard atomic weight Monoisotopic mass Difference
H1.0081.00783+0.025%
C12.01112.000-0.092%
N14.00714.003-0.029%
O15.99915.995-0.025%
Cl35.45334.969-1.37%
Br79.90478.918-1.23%

For most elements the difference is small. For Cl and Br, which have two common isotopes in roughly equal abundance, the standard weight and monoisotopic mass differ by over 1%. In high-resolution mass spectrometry, that difference is the entire point of the technique.

Use this calculator for standard chemistry. For mass spec work, use a monoisotopic mass calculator.

Standard atomic masses are right for almost everything. Monoisotopic masses are right for mass spectrometry. Knowing which one you need prevents a category of errors that can take hours to diagnose.

The lab scenario: preparing 0.5M KMnO₄

A concrete example of molar mass in practice.

Potassium permanganate (KMnO₄) is a common oxidising agent used in redox titrations and water treatment. You need 250 mL of a 0.5M solution.

Step 1: Calculate moles needed. 0.5 mol/L × 0.250 L = 0.125 mol

Step 2: Calculate molar mass of KMnO₄. K = 39.098 × 1 = 39.098 Mn = 54.938 × 1 = 54.938 O = 15.999 × 4 = 63.996 Total = 158.032 g/mol

Step 3: Calculate mass to weigh. 0.125 mol × 158.032 g/mol = 19.754 g

Step 4: Weigh 19.75 g of KMnO₄ on an analytical balance. Dissolve in about 200 mL of distilled water in a 250 mL volumetric flask. Make up to the 250 mL mark.

Result: 0.5M KMnO₄ solution.

If you used 158 g/mol instead of 158.032, your mass would be 19.750 g instead of 19.754 g. A 0.004 g difference. At this scale, that’s well within the balance’s precision, and it doesn’t matter.

If you used a rough approximation of 158 × 0.125 = 19.75 g, same result. The precision of your balance (±0.001 g on most analytical balances) dominates the uncertainty, not the molar mass precision.

The point: use full precision in the calculation, then let your measurement precision limit the final answer.

Molar mass calculation is not the hard part

The arithmetic is straightforward. Multiply atom count by atomic mass, sum the results.

What trips people up is formula parsing: subscripts that apply only to the preceding element, parentheses that multiply entire groups, hydrate notation that adds water molecules to the count. Miss any of these and your molar mass is wrong, which makes every calculation that follows wrong.

This calculator handles the parsing automatically. You enter the formula exactly as it’s written in your textbook or on the reagent bottle. You get the molar mass with a breakdown that shows where each gram per mole came from.

Check the breakdown against what you expect. If the atom counts don’t match the formula, the formula entry is wrong. Fix it before you run the calculation that depends on it.

Frequently Asked Questions

What is molar mass?

Molar mass is the mass of one mole of a substance, expressed in grams per mole (g/mol). It equals the sum of the atomic masses of all atoms in the molecular formula, weighted by their count.

What is the difference between molar mass and molecular mass?

Molecular mass (or molecular weight) is the mass of a single molecule in atomic mass units (u or Da). Molar mass is the same number but in g/mol — numerically identical but refers to a mole of molecules rather than one.

Why is molar mass important?

Molar mass lets you convert between grams (a measurable lab quantity) and moles (used in stoichiometry). It is essential for solution preparation, titrations, and limiting reagent calculations.

How do I handle ionic compounds like NaCl?

For ionic compounds, enter the empirical formula (NaCl, CaCO₃, etc.) and the calculator gives the formula mass — effectively the molar mass for ionic compounds. There is no true "molecule" for ionic lattices, but the formula mass is used identically.

What is the molar mass of glucose (C₆H₁₂O₆)?

C₆H₁₂O₆: (6 × 12.011) + (12 × 1.008) + (6 × 15.999) = 72.066 + 12.096 + 95.994 = 180.156 g/mol. This is one of the most important values in biochemistry — blood sugar levels are often expressed in mmol/L using this molar mass.

What is the molar mass of sulfuric acid (H₂SO₄)?

H₂SO₄: (2 × 1.008) + 32.065 + (4 × 15.999) = 2.016 + 32.065 + 63.996 = 98.077 g/mol. Concentrated sulfuric acid is 98% pure and has a density of 1.84 g/mL, making it 18.4 M (molar concentration).

How do I calculate percent composition from molar mass?

Percent composition of element X = (mass of X in formula / molar mass of compound) × 100. For H₂O: O contribution = 15.999 / 18.015 = 88.8%. H contribution = 2.016 / 18.015 = 11.2%. This is used in combustion analysis to verify compound identity.

What is the difference between empirical and molecular formula?

Empirical formula is the simplest whole-number ratio of atoms: CH₂O. Molecular formula shows the actual count: glucose is C₆H₁₂O₆ (6× the empirical formula). To find molecular formula from empirical: divide the known molar mass by the empirical formula mass and multiply all subscripts by that factor.

What is atomic mass unit (amu) and how does it relate to g/mol?

1 amu (atomic mass unit, also written u or Da) is 1/12 the mass of a carbon-12 atom = 1.66054 × 10⁻²⁴ g. By definition, the molar mass of an element in g/mol is numerically equal to its atomic mass in amu. Carbon has an atomic mass of 12.011 amu and a molar mass of 12.011 g/mol. This equivalence is due to Avogadro's number.

How do I enter a hydrate formula like CuSO₄·5H₂O?

Type it as CuSO4(H2O)5 in this calculator. The parser treats parentheses as groups and multiplies by the subscript. The result includes the water of crystallisation: CuSO₄ contributes 159.61 g/mol and 5H₂O contributes 90.08 g/mol, giving a total of 249.69 g/mol for copper(II) sulfate pentahydrate.

Related Calculators