Molar Mass Calculator

Compute molar mass from any chemical formula.

Science Any formula % by mass IUPAC 2021
Rate this calculator · 5.0 (1)

Molar Mass Calculator

Formula parser - percent by mass - IUPAC 2021

Instructions — Molar Mass Calculator

Type any chemical formula into the input. The calculator parses the formula and sums the atomic weights of every element.

  1. Use proper case: element symbols start with an uppercase letter, optionally followed by a lowercase letter. H, He, Cu, Au are valid. h, HE, cu are not.
  2. Numbers after a symbol give the subscript count: H2O has two hydrogens; C6H12O6 has six carbons.
  3. Parentheses with a multiplier work as expected: Ca(OH)2 expands to one Ca, two O, and two H. Nested parens are supported.
  4. Hydrates: rewrite as a single formula. CuSO4·5H2O becomes CuSO4(H2O)5 in this parser, or simply expand to CuSO9H10.

The output shows total molar mass, then a per-element breakdown with atomic mass, count, contribution, and percent by mass.

Formulas

Molar mass is the sum of atomic masses, weighted by the number of atoms of each element in the formula:

$$ M = \sum_{i} A_i \cdot n_i $$

where A_i is the standard atomic weight of element i (from IUPAC tables) and n_i is the number of atoms of that element in one formula unit.

Mass-to-moles conversion:

$$ n = \frac{m}{M} $$

Number of molecules from moles (Avogadro's constant N_A = 6.02214076 × 10^23):

$$ N = n \cdot N_A $$

Percent by mass of an element in the compound:

$$ \%_i = \frac{A_i \cdot n_i}{M} \times 100 $$

Reference

Common compounds:

CompoundFormulaMolar mass (g/mol)
WaterH2O18.015
Carbon dioxideCO244.009
Sodium chlorideNaCl58.44
GlucoseC6H12O6180.156
SucroseC12H22O11342.30
Sulfuric acidH2SO498.08
Sodium hydroxideNaOH40.00
Calcium carbonateCaCO3100.09
AspirinC9H8O4180.16
CaffeineC8H10N4O2194.19

Source: IUPAC 2021 standard atomic weights. The most stable isotope is used for radioactive elements.

Article — Molar Mass Calculator

Molar Mass Calculator: From Chemical Formula to g/mol

Molar mass is the mass of one mole of a substance, in grams per mole. It equals the sum of every atomic mass in the formula: M = sum of (A_i · n_i). Water is 18.015 g/mol; glucose is 180.16 g/mol; sodium chloride is 58.44 g/mol. The molar mass calculator parses any chemical formula and returns the total mass plus a breakdown by element.

The same number that lists each element on the periodic table reappears in laboratory work every time a chemist weighs out a reagent. Molar mass is the bridge between the world we can see (a 5 g pile of salt on a balance) and the world we cannot (an inconceivable number of Na and Cl ions).

What molar mass measures

One mole is defined as exactly 6.02214076 × 10^23 particles, redefined in 2019 to be a fixed constant of nature. The molar mass tells you how many grams of a substance contain that many formula units. For water, one mole of H2O molecules weighs 18.015 grams. For carbon-12, one mole weighs exactly 12.000 grams, by definition the anchor of the atomic-mass scale.

Because chemistry is fundamentally about ratios of atoms (one carbon reacts with two oxygens to make CO2), expressing quantities in moles rather than grams makes stoichiometry tractable. The calculator does the conversion: enter a formula, get the molar mass, and you can divide any laboratory mass by it to recover moles.

How to calculate molar mass

The procedure has two steps. Count each element in the formula. Then sum the atomic mass times the count.

Worked examples
H2O 2(1.008) + 15.999 = 18.015 g/mol
NaCl 22.990 + 35.45 = 58.44 g/mol
C6H12O6 6(12.011) + 12(1.008) + 6(15.999) = 180.156 g/mol
H2SO4 2(1.008) + 32.06 + 4(15.999) = 98.08 g/mol

The atomic-weight values come from the IUPAC 2021 standard atomic weights table, which the calculator uses internally. They are weighted averages of the natural isotope abundances; chlorine appears as 35.45 because Earth's chlorine is a 76:24 blend of Cl-35 and Cl-37.

Molar mass versus molecular weight

In casual chemistry the two terms are interchangeable. Strictly: molecular weight (or relative molecular mass M_r) is a unitless ratio of average molecule mass to 1/12 of a carbon-12 atom; molar mass is the same number expressed in grams per mole. M_r for water is 18.015 (no units); molar mass is 18.015 g/mol.

Biochemists often use daltons (Da) for protein molecular weight, where 1 Da = 1 g/mol. A 50 kDa protein has a molar mass of 50,000 g/mol. The numerical equivalence makes the units a convenience rather than a hard distinction.

Did you know

Before 1961 atomic masses were normalized to oxygen-16, which gave physicists and chemists slightly different scales. The shift to carbon-12 unified the two systems and changed every periodic-table value by about 0.003%. Old textbooks list water as 18.016 g/mol; modern values give 18.015 g/mol because of refined isotope-abundance measurements.

Parentheses, hydrates, and tricky formulas

The subscript after a closing parenthesis multiplies every atom inside. Ca(OH)2 means one calcium, two oxygens, and two hydrogens. The parser handles arbitrary nesting: Mg3(PO4)2 yields three magnesiums, two phosphoruses, eight oxygens.

Hydrates are written with a center dot: CuSO4·5H2O. The dot means "plus five separately bound water molecules per copper sulfate unit." The molar mass adds 5 × 18.015 = 90.08 g/mol to the anhydrous 159.61 to give 249.69 g/mol. The calculator handles this by extending the formula: type CuSO4(H2O)5 to compute the same value.

Percent composition from molar mass

Dividing each element's contribution by the total molar mass gives its percent by mass. This is one of the most-used quantities in analytical chemistry, both for verifying compound identity and for buying materials by element content (think iron ore: weight-percent Fe is the trade metric).

CompoundElementPercent by mass
H2OH11.19%
H2OO88.81%
CO2C27.29%
CO2O72.71%
NaClNa39.34%
NaClCl60.66%
Fe2O3 (hematite)Fe69.94%

Common molar masses

  • H2O: 18.015 g/mol
  • NaCl: 58.44 g/mol
  • CO2: 44.01 g/mol
  • O2: 32.00 g/mol
  • N2: 28.01 g/mol
  • Glucose (C6H12O6): 180.16 g/mol
  • Sucrose (C12H22O11): 342.30 g/mol
  • Ethanol (C2H5OH): 46.07 g/mol
  • Aspirin (C9H8O4): 180.16 g/mol
  • Air (mix): about 28.97 g/mol

Where molar mass shows up

Preparing solutions. Want 1 L of 0.1 M NaOH? Molar mass of NaOH is 40.00 g/mol; you need 0.1 mol = 4.00 g. Every dilution problem and every titration calculation starts with a molar-mass lookup.

Drug dosing. Most drug doses are reported in mg, but pharmacological receptor binding is expressed in molar concentration. Going from mg/kg body weight to nanomolar at the receptor requires the drug's molar mass at every step.

Combustion stoichiometry. Burning methane: CH4 + 2 O2 -> CO2 + 2 H2O. To find the mass of CO2 produced per gram of methane, divide by methane's molar mass (16.04) and multiply by CO2's (44.01); ratio 2.74 g CO2 per g methane.

Molar mass mistakes

Diatomic gas confusion

The element oxygen has atomic mass 15.999, but molecular oxygen O2 has molar mass 31.998. Hydrogen H is 1.008 g/mol; H2 gas is 2.016 g/mol. For the seven common diatomic elements (H, N, O, F, Cl, Br, I), always check whether the problem asks for atomic or molecular mass.

Other regular slips: forgetting subscripts (counting the 2 in H2O as 1), ignoring parentheses in Ca(OH)2 and getting 57 instead of 74, mixing up atomic numbers with atomic masses (carbon is 12.011 g/mol, not 6 g/mol), and using rounded values in early steps that compound into a noticeable final error.

Tip

For laboratory work, carry one or two extra digits during intermediate steps and round only at the end. Atomic weights to three decimals (H = 1.008, C = 12.011, O = 15.999) are accurate enough for almost any practical purpose; using H = 1 introduces a 1% error that propagates through every subsequent calculation.

FAQ

Molar mass is the mass of one mole of a substance, expressed in grams per mole (g/mol). Numerically it equals the sum of the atomic masses (in atomic-mass units) of every atom in the formula. One mole contains 6.02214076 × 10^23 particles.
For each element in the formula, multiply the atomic weight by the number of atoms of that element in the formula. Sum the products. Example for H2O: (2 × 1.008) + (1 × 15.999) = 18.015 g/mol.
Atomic mass is the mass of a single atom in atomic-mass units (u or Da). Molar mass is the mass of one mole of atoms or molecules, in g/mol. Numerically they are equal, but the units differ: an oxygen atom has mass 15.999 u; one mole of oxygen atoms has mass 15.999 g.
Expand them. The subscript after the closing parenthesis multiplies every atom inside. Ca(OH)2 means one Ca, two O, and two H. (NH4)2SO4 means two N, eight H, one S, and four O. Nested parentheses work the same way, evaluated innermost first.
The dot in a hydrate formula means "plus separately bound water of crystallization." To compute molar mass, treat the hydrate as a single compound: add 5 × (molar mass of H2O) to the anhydrous molar mass. CuSO4 (159.61) + 5(18.015) = 249.69 g/mol for CuSO4·5H2O.
Divide the contribution of each element by the total molar mass and multiply by 100. For H2O: 2(1.008)/18.015 = 11.19% hydrogen and 15.999/18.015 = 88.81% oxygen by mass. The percentages always sum to 100%.
Most elements occur as a mixture of isotopes with different masses. The tabulated value is the weighted average of all natural isotopes for that element. Chlorine, for example, is 76% Cl-35 and 24% Cl-37, giving an average of about 35.45.
Earth's atmosphere is roughly 78% N2 and 21% O2 by mole fraction. M(air) = 0.78(28.014) + 0.21(31.998) +... = about 28.97 g/mol. This is why hot air rises: the same volume of warmer air contains fewer of these "average" molecules and weighs less.