Molar Mass Calculator

Find the molar mass of any chemical formula, with each element's share.

Molar Mass Calculator tool

Case matters: Co is cobalt, CO is carbon monoxide. Hydrates: CuSO4·5H2O or CuSO4.5H2O

—
Molar mass
—
Atoms in the formula
—
Formula read as

About the Molar Mass Calculator

Chemistry calculations, from making solutions to balancing reactions, start with molar mass. This molar mass calculator reads any formula, including brackets and hydrates, and adds up the atomic masses: sulfuric acid, H2SO4, comes to about 98.07 g/mol, and copper sulfate pentahydrate to about 249.68 g/mol. It also lists each element's share of the mass, which is useful for percent composition problems.

The calculation multiplies each element's standard atomic weight by the number of atoms of that element and adds the results. Subscripts apply to the element just before them, a number after a closing bracket multiplies everything inside, and the water of a hydrate is added on. Element symbols are case-sensitive, so Co is cobalt while CO is carbon monoxide. Atomic weights follow IUPAC standard values, rounded to about five significant figures.

Example: water, H2O, is 2 × 1.008 + 15.999 = 18.015 g/mol, of which oxygen makes up about 88.8% by mass. Glucose, C6H12O6, is 180.156 g/mol. Calcium hydroxide, Ca(OH)2, is 74.092 g/mol. Copper(II) sulfate pentahydrate, CuSO4·5H2O, is 249.677 g/mol, of which about 36.1% is water.

Molar mass converts between grams and moles: moles = mass ÷ molar mass. Use it with the molarity calculator to make solutions, the percent yield calculator for reactions, and the ideal gas law calculator for gases.

How to use the Molar Mass Calculator

  1. Type the formulaUse correct capitalization, such as NaCl, H2SO4 or Ca(OH)2.
  2. Add hydrates or groupsWrite hydrates with a dot, CuSO4·5H2O or CuSO4.5H2O, and groups in brackets.
  3. Read the molar massSee the molecular weight in g/mol.
  4. Check the breakdownSee each element's atom count, mass contribution and mass percent.

Molar Mass Calculator features

  • Molar mass of any formula
  • Parentheses, brackets and nested groups
  • Hydrates and coefficients
  • Element-by-element breakdown
  • Mass percent composition
  • All 118 elements
  • IUPAC standard atomic weights

Common uses

  • Chemistry homework and lab prep
  • Converting grams to moles
  • Making solutions of a set molarity
  • Percent composition problems
  • Checking formula masses in reports

Molar mass in practice: salt and sodium, fertilisers, baking soda, fuel and counting molecules

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

Molar mass connects the chemical formula of a substance with its mass, which turns chemistry from symbols into real quantities. It explains how much sodium is in table salt, how much nitrogen a bag of urea supplies to a field, how much carbon dioxide a litre of petrol produces and how many molecules are in a glass of water. This guide works through each of these examples with real numbers.

A worked example: salt and sodium

Table salt, sodium chloride, has a molar mass of 22.990 + 35.45 = 58.44 g/mol, and sodium makes up about 39.3% of it by mass. That is why 5 g of salt contains about 2 g of sodium. The World Health Organization recommends that adults keep salt intake below 5 g a day, or sodium below 2 g, to reduce the risk of high blood pressure. Food labels sometimes show sodium rather than salt, and multiplying sodium by about 2.5 converts it to salt.

Fertilisers in the field

Urea, CO(NH2)2, is the most widely used nitrogen fertiliser in Pakistan. Its molar mass is about 60.06 g/mol, and its two nitrogen atoms make up about 46.6% of its mass. A 50 kg bag of urea therefore supplies about 23 kg of nitrogen. Diammonium phosphate, DAP, contains about 21% nitrogen by the same calculation, along with phosphorus. Farmers and agronomists use these percentages to match fertiliser to the nutrients a crop needs.

Baking soda

Baking soda, sodium bicarbonate, NaHCO3, has a molar mass of about 84.01 g/mol. When it reacts with an acid, such as yoghurt, lemon juice or buttermilk in a recipe, it releases carbon dioxide that makes cakes and breads rise. Using molar masses, chemists can calculate how much acid is needed to react completely, which is why recipes balance soda with acidic ingredients.

Carbon dioxide from fuel

Petrol is a mixture of hydrocarbons, but octane, C8H18, with a molar mass of about 114.23 g/mol, is a reasonable stand-in. Burning one molecule of octane produces eight molecules of carbon dioxide, so 1 kg of octane produces about 3.08 kg of CO2. With petrol's density of about 0.74 kg per litre, each litre burned releases roughly 2.3 kg of carbon dioxide, a figure used in carbon footprint calculations.

Counting molecules

A mole contains exactly 6.02214076 × 10²³ particles, the Avogadro constant, fixed by definition since 2019. A 250 ml glass of water, about 250 g, contains 250 ÷ 18.015, about 13.9 moles of water, or roughly 8.4 × 10²⁴ molecules. Numbers this large are why chemists count in moles rather than in individual molecules.

Mass percent and purity

Molar masses also give the percentage of each element in a compound, which helps check the purity or composition of materials. In a laboratory, comparing the measured mass percent of an element with the calculated value can reveal whether a sample is pure or contaminated.

Hydrates

Some compounds hold water within their crystals, and the water counts in the molar mass. Weighing a hydrate when the recipe calls for the dry compound, or the reverse, leads to errors in concentration, so checking the exact formula on the label matters in the laboratory.

Common mistakes

  • Writing formulas with the wrong capitalisation, such as CO instead of Co.
  • Forgetting the water in hydrates.
  • Mixing up sodium and salt on food labels.
  • Using rounded atomic masses when precision matters.

Related tools

To prepare solutions, use Molarity Calculator. For reaction efficiency, try Percent Yield Calculator, and to dilute stock solutions, Dilution Calculator.

Medicines and salts

Pharmacists use molar masses when comparing different salts of the same medicine, because the active part makes up a different share of the mass in each salt. A dose written for one form of a drug cannot simply be swapped gram for gram with another form. These calculations are made by professionals, but they show how chemistry underpins safe dosing.

Water treatment

Water treatment plants add chemicals such as chlorine compounds and alum in carefully calculated amounts, based on molar masses and the volume of water treated. Too little leaves germs or cloudiness, while too much wastes chemicals and affects taste. Similar calculations lie behind the dosing instructions on chlorine tablets used to treat drinking water in emergencies.

Light and heavy gases

Air has an average molar mass of about 29 g/mol, so gases with a lower molar mass, such as helium at 4 g/mol, rise in air, while heavier gases, such as carbon dioxide at 44 g/mol, sink and can collect in low places. This is why carbon dioxide can build up dangerously in wells, cellars and grain stores, which should be ventilated before anyone enters.

Checking a formula

When entering a formula, check element symbols carefully: the first letter is always a capital and any second letter lower case, so Co is cobalt while CO is carbon monoxide. Brackets apply to everything inside them, and the water in a hydrate is written after a dot. A small error in the formula gives a completely different molar mass.

Limits

Atomic masses are standard values for natural isotope mixtures. Results are accurate for normal chemistry but not for isotopically enriched materials.

Frequently asked questions

What is molar mass?

The mass of one mole of a substance, in grams per mole. One mole contains about 6.022 × 10²³ particles, and the molar mass in g/mol equals the formula mass in atomic mass units.

How do I calculate molar mass?

Multiply each element's atomic mass by the number of its atoms in the formula and add everything up. For CO2: 12.011 + 2 × 15.999 = 44.009 g/mol.

What is the difference between molar mass and molecular weight?

In practice they have the same number. Molar mass has units of g/mol, while molecular weight is often quoted without units or in daltons, the mass of one molecule in atomic mass units.

How do I enter a hydrate?

Separate the water with a dot: CuSO4·5H2O, or CuSO4.5H2O with a full stop. The calculator adds five water molecules, 5 × 18.015 g/mol, to the mass of the salt.

Why does capitalization matter?

Element symbols are case-sensitive. Co is cobalt, but CO is one carbon and one oxygen. Always start each element symbol with a capital letter and follow with lowercase.

How do I convert grams to moles?

Divide the mass by the molar mass. 36 g of water is 36 ÷ 18.015 ≈ 2 moles. To go the other way, multiply moles by the molar mass.

What is mass percent?

The share of a compound's mass that comes from one element: the element's total mass in the formula divided by the molar mass, times 100. Carbon is about 27.3% of CO2 by mass.

Where do atomic weights come from?

From IUPAC's standard atomic weights, which average the masses of each element's naturally occurring isotopes. Radioactive elements without stable isotopes use the mass number of their longest-lived isotope.

How do I write a formula with brackets?

Put the repeated group in round or square brackets and write its count after the closing bracket, such as Al2(SO4)3 for aluminium sulfate. The calculator multiplies every atom inside the brackets by that count.