Skip to content
ScienceQuest

Molar Mass Calculator

CalculatorSchool Updated

Support ScienceQuest on Buy Me a Coffee (opens in a new tab)

Work out molar mass from any chemical formula, including hydrates, convert grams to moles and to particles, and see each element’s percent composition.

Calculator

Brackets, nested groups and hydrates all work.

MoreLessabout the formula

Use ·, * or a full stop before the water of crystallization.

Molar mass
180.156 g/mol
Atoms per unit
24
Distinct elements
3

Percent composition

ElementCountAtomic massContributionMass %
O Oxygen615.99995.99453.28%
C Carbon612.01172.06640%
H Hydrogen121.00812.0966.714%

Convert

Amount of substance 5.5507 mmol 3.3427 × 10²¹ formula units

The whole sample

Mass
1 g
Amount
5.5507 mmol
Formula units
3.3427 × 10²¹
Atoms in total
The formula units times the atoms in one unit.
8.0226 × 10²²
ElementPer unitAtomsMoles of atomsMass
O Oxygen62.0056 × 10²²33.304 mmol532.84 mg
C Carbon62.0056 × 10²²33.304 mmol400.02 mg
H Hydrogen124.0113 × 10²²66.609 mmol67.142 mg

Formula units N = n × NA, where the Avogadro constant NA is 6.02214076 × 10²³ mol⁻¹ exactly. Each element’s atoms are N times its count in the formula, and its mass is the sample’s mass times its mass percent over 100.

Cite this tool

Citing this tool

Last updated . Add the date you accessed it as well, which a citation of a page that can change asks for. If a specific result matters, cite the permalink from the tool’s share row instead of this page: it reproduces the exact parameters.

On the syllabus: AP Chemistry, Unit 1: Atomic Structure and Properties; MCAT, 4E: Atoms, nuclear decay, electronic structure, and atomic chemical behavior.

Teaching with this? You can put it on a class page or LMS for free, with no ads inside the frame. Get the embed code.

The equation

M=Mu∑iniAr,iM = M_u \sum_i n_i A_{r,i}

IUPAC CIAAW, Abridged Standard Atomic Weights 2024

The equation as an image to reuse
Molar Mass Calculator: the equation M = M u Σ i n i A r,i.
The equation the calculator is built on, with its source. Image © ScienceQuest, CC BY 4.0. Free to reuse with credit and a link to this page; how to reuse it. Download PNG

What is molar mass and how is it calculated?

Molar mass (M) is the mass of one mole of a substance, in grams per mole (g/mol). To calculate it, multiply each element’s standard atomic weight by the number of its atoms in the formula and add the results: M = Σ (count × atomic weight). One mole of any substance contains exactly 6.02214076 × 10²³ particles (Avogadro’s number).

Common chemical compounds & molar masses

Each mass below comes from the calculator’s own parser, so typing any formula from the table into the tool above gives the same figure:

Molar masses of common laboratory and everyday chemical compounds
Compound Name Formula Molar Mass (g/mol)
Water H₂O 18.015
Carbon dioxide CO₂ 44.009
Sodium chloride (table salt) NaCl 58.44
Aluminum (elemental) Al 26.982
Glucose C₆H₁₂O₆ 180.156
Sucrose (table sugar) C₁₂H₂₂O₁₁ 342.297
Ethanol C₂H₅OH 46.069
Sulfuric acid H₂SO₄ 98.072
Copper(II) sulfate CuSO₄ 159.602
Sodium hydroxide NaOH 39.997
Acetic acid (vinegar) CH₃COOH 60.052
Calcium carbonate CaCO₃ 100.086
Hydrochloric acid HCl 36.458
Ammonia NH₃ 17.031

For reaction calculations, see the Stoichiometry Calculator or balance equations with the Chemical Equation Balancer.

How a molar mass is assembled

Adding up a molar mass is bookkeeping, and the usual errors are miscounts: a bracketed group counted once, or the waters of a hydrate left out.

Each atomic weight is an average over the element’s natural isotopes, weighted by abundance, which puts some far from a whole number. Chlorine is quoted as 35.45 rather than 35 because natural chlorine is roughly three parts chlorine-35 to one part chlorine-37. This calculator uses the IUPAC CIAAW abridged atomic weights, given to at most five significant figures.

Worked example: the molar mass of glucose

Glucose, C₆H₁₂O₆, has three elements and three terms:

  • Carbon: 6 × 12.011 = 72.066
  • Hydrogen: 12 × 1.008 = 12.096
  • Oxygen: 6 × 15.999 = 95.994
  • Total: 72.066 + 12.096 + 95.994 = 180.156 g/mol

Textbooks round this to 180.16 g/mol, the same figure to five significant figures. Rounding the atomic weights before you multiply introduces drift, so keep the full values until the final addition.

How to convert grams to moles

Divide the mass by the molar mass: n = m / M. Going the other way, moles to grams, multiply instead: m = n × M. To count the particles in the sample, multiply the moles by the Avogadro constant, N = n × N_A, where N_A = 6.02214076 × 10²³ mol⁻¹ exactly; to go from a number of particles back to moles, divide by it. The calculator does all three from whichever quantity you give it: choose Mass → moles, Moles → mass or Particles → moles under Convert. The panel under it lists the whole sample as a mass, an amount in moles, a number of formula units and a number of atoms, then splits the atoms and the mass by element.

A formula unit is one copy of the formula as written. For a molecular substance such as water it is one molecule, and for a lone element such as iron it is one atom. An ionic solid such as sodium chloride has no molecules, so its particles are counted as formula units of NaCl, each one sodium ion and one chloride ion. Given a count of atoms, the calculator first divides it by the atoms in one formula unit: 2 × 10²⁴ atoms of NaCl are 10²⁴ formula units, because each unit holds two.

Worked example: 10 g of water to moles and molecules

Water, H₂O, has a molar mass of 2 × 1.008 + 15.999 = 18.015 g/mol. Then:

  • Moles: n = 10 g / 18.015 g/mol = 0.55509 mol, which the calculator shows as 555.09 mmol
  • Molecules: N = 0.55509 mol × 6.02214076 × 10²³ mol⁻¹ = 3.3428 × 10²³
  • Atoms of hydrogen: 2 × N = 6.6857 × 10²³, and of oxygen 1 × N = 3.3428 × 10²³
  • Atoms in total: 3 × N = 1.0029 × 10²⁴

The reverse runs the same equations backwards: 1.0 × 10²⁴ molecules of water are 10²⁴ / (6.02214076 × 10²³) = 1.6605 mol, and 1.66054 mol × 18.015 g/mol = 29.915 g. Carry the unrounded moles into the second step, as the calculator does: 1.6605 × 18.015 gives 29.914, and the last figure drifts.

Percent composition by mass

Each element’s share of the molar mass is its count times its atomic weight, divided by the molar mass, times 100: % = count × A_r / M × 100. The Percent composition table above prints it for every element in the formula, with a bar for each, and the shares add up to 100%, give or take rounding in the last figure.

For water, hydrogen is 2.016 / 18.015 × 100 = 11.19% and oxygen is 15.999 / 18.015 × 100 = 88.81%. Because the share is the same in any amount of the compound, the 10 g sample above holds 1.1191 g of hydrogen and 8.8809 g of oxygen, the masses the whole-sample table lists. To go the other way, from measured percentages back to a formula, use the Empirical Formula Calculator, which divides each percentage by its atomic weight and finds the whole-number ratio. For an amount in solution rather than a weighed solid, the Molarity Calculator takes the molar mass and a volume instead.

How much precision to carry

The molar mass is rarely the limiting source of uncertainty. A balance reading 2.922 g to the nearest milligram carries about one part in three thousand, looser than the atomic weights of most elements. Two decimal places of molar mass are enough for solution preparation, and more digits do not make a weighing more accurate.

Lithium, boron, sulfur and lead are among the exceptions, because their isotopic composition differs measurably between sources. CIAAW quotes an interval for each rather than a single value. For high-accuracy isotope work, use the value measured for your material instead of the conventional average.

Common mistakes

  • Using the anhydrous mass for a hydrate. CuSO₄ is 159.60 g/mol, but CuSO₄·5H₂O is 249.68 g/mol. The waters of crystallization are part of the solid being weighed, so omitting them makes you weigh about 36% too little.
  • Misreading capitalization. Co is cobalt at 58.933 g/mol while CO is carbon monoxide at 28.010 g/mol. A single case error changes the answer by more than a factor of two.
  • Not distributing a bracketed group. Ca(OH)₂ contains two oxygens and two hydrogens, giving 74.092 g/mol. Counting one of each gives 57.085 and is a common slip in hydroxides and nitrates.
  • Ignoring reagent purity. Molar mass assumes the pure compound. For a reagent supplied at 97%, divide the calculated mass by 0.97 to get the mass to weigh out.

Sources

  • Atomic weights: IUPAC CIAAW, Abridged Standard Atomic Weights 2024, based on the Atomic Weights 2021 report with the 2024 revisions for gadolinium, lutetium and zirconium. The intervals for lithium, boron, sulfur and lead: CIAAW, Standard Atomic Weights.
  • Chlorine’s isotopes, chlorine-35 at 0.755 to 0.761 and chlorine-37 at 0.239 to 0.245 of the atoms: CIAAW, Chlorine.
  • The Avogadro constant, 6.02214076 × 10²³ mol⁻¹ exactly, and the molar mass constant, 1.00000000105 × 10⁻³ kg/mol: NIST CODATA 2022, NA and Mu.

Worked examples

Each one runs through the calculator above, so the arithmetic here is the arithmetic it does.

What is the molar mass of Epsom salt, MgSO4·7H2O?

  1. O: 11 × 15.999 = 175.989 g/mol, 71.4% of the mass
  2. S: 1 × 32.06 = 32.06 g/mol, 13.01% of the mass
  3. Mg: 1 × 24.305 = 24.305 g/mol, 9.861% of the mass
  4. H: 14 × 1.008 = 14.112 g/mol, 5.726% of the mass
  5. M(MgSO4·7H2O) = 175.989 + 32.06 + 24.305 + 14.112 = 246.466 g/mol

Water makes up 51% of Epsom salt by mass, since the seven waters add 7 × 18.015 = 126.1 g/mol to the formula. Count their oxygen with the sulfate’s, 4 + 7 = 11 O. PubChem lists Epsom salt as magnesium sulfate heptahydrate.

How many molecules of aspirin are in one 81 mg baby aspirin?

  1. C: 9 × 12.011 = 108.099 g/mol, 60% of the mass
  2. O: 4 × 15.999 = 63.996 g/mol, 35.52% of the mass
  3. H: 8 × 1.008 = 8.064 g/mol, 4.476% of the mass
  4. M(C9H8O4) = 108.099 + 63.996 + 8.064 = 180.159 g/mol
  5. m = 81 mg = 0.081 g
  6. n = m / M = 0.081 g / 180.159 g/mol = 449.6 µmol
  7. N = n × N_A = 0.0004496 mol × 6.02214076 × 10²³ mol⁻¹ = 2.7076 × 10²⁰ formula units

An 81 mg tablet, the low dose MedlinePlus calls “baby aspirin,” holds about 2.7 × 10²⁰ molecules. The calculator counts formula units, and for a molecular compound such as aspirin each formula unit is one molecule. Change the milligrams to grams before you divide by the molar mass, or the answer comes out a thousand times too big.

How many grams of sodium chloride are in 154 mmol of NaCl?

  1. Cl: 1 × 35.45 = 35.45 g/mol, 60.66% of the mass
  2. Na: 1 × 22.99 = 22.99 g/mol, 39.34% of the mass
  3. M(NaCl) = 35.45 + 22.99 = 58.44 g/mol
  4. n = 154 mmol = 0.154 mol
  5. m = n × M = 0.154 mol × 58.44 g/mol = 8.9998 g
  6. N = n × N_A = 0.154 mol × 6.02214076 × 10²³ mol⁻¹ = 9.2741 × 10²² formula units

A liter of 0.9% saline holds this much salt: the FDA label for 0.9% Sodium Chloride Injection, USP gives 154 mEq/L of sodium and 9 g/L of NaCl. Sodium carries one charge, so you can read 154 mEq as 154 mmol, which weighs 9.00 g as NaCl.

Common questions

What is the difference between molar mass and molecular weight?

Only the units: molecular weight is a relative mass and strictly dimensionless, while molar mass carries units of grams per mole, and numerically they are the same figure. In everyday lab use the two terms are used interchangeably, and both come from summing the standard atomic weights in the formula.

How do I handle a hydrate like CuSO4·5H2O?

Include the water. Type the dot as ·, * or a full stop and the waters of crystallization are added to the total. Anhydrous copper sulfate is 159.60 g/mol but the pentahydrate is 249.68, so using the wrong one makes you weigh out about 36 percent too little.

Which atomic weights does this use?

The IUPAC CIAAW abridged standard atomic weights, quoted to five significant figures. Elements with no characteristic isotopic composition on Earth, such as technetium, promethium and most elements from polonium upwards, have no standard atomic weight, so the mass number of the longest-lived isotope, or of one of them where CIAAW lists several, is used instead and the result is flagged as nominal.

How do I convert grams to moles?

Divide the mass by the molar mass, n = m / M. Water is 18.015 g/mol, so 10 g of it is 10 / 18.015 = 0.55509 mol. Choose Mass → moles under Convert and the calculator divides by the molar mass of whatever formula you type; Moles → mass multiplies instead, m = n × M.

How many molecules or atoms are in a sample?

Multiply the moles by the Avogadro constant, exactly 6.02214076 × 10²³ per mole, for the number of formula units, then by the atoms in one formula unit for the number of atoms. 10 g of water is 0.55509 mol, which is 3.3428 × 10²³ molecules and 1.0029 × 10²⁴ atoms. Particles → moles runs the same steps backwards from a count of formula units or atoms.

How do I find the percent composition of a compound?

Divide each element’s contribution to the molar mass by the molar mass and multiply by 100. In water, hydrogen contributes 2 × 1.008 = 2.016 of the 18.015 g/mol, which is 11.19 percent, and oxygen the other 88.81 percent. The Percent composition table shows this for every element in the formula you type.

Can I work out a formula from percent composition?

Not with this calculator, which goes from a formula to its percentages. The empirical formula calculator goes the other way: it divides each mass percentage by its atomic weight, scales the results to the smallest whole-number ratio, and with a molar mass also gives the molecular formula.