Skip to content

Moles Calculator: Grams to Moles and Moles to Grams

Convert grams to moles and back, from a formula’s molar mass, a particle count, a solution or a gas.

Your details

Unit system
Molar mass from

Case matters (Co ≠ CO). Brackets and hydrates are accepted: Ca(OH)2, K4[Fe(CN)6], CuSO4·5H2O or CuSO4.5H2O.

Results update as you type

Amount of substance n

1.9983 mol

In millimoles
1,998.3347 mmol
Number of particles N
1.2034 × 10²⁴
Molar mass used
18.015 g/mol
Mass composition
H 11.19 % · O 88.81 %

Step-by-step solution
  1. n = m / M = 36 g ÷ 18.015 g/mol = 1.99833 mol
  2. N = n × Nₐ = 1.99833 × 6.02214076 × 10²³ = 1.2034 × 10²⁴

The mole is how chemists count. One mole contains exactly 6.02214076 × 10²³ entities — atoms, molecules, ions or formula units — and since the 2019 revision of the SI this number, the Avogadro constant, is fixed by definition. Balanced equations, concentrations and gas laws are all written in moles, so almost every chemistry calculation starts by converting what you can measure (a mass on a balance, a volume of solution, the pressure of a gas) into an amount of substance.

This moles calculator does that conversion in five ways. Grams to moles divides a mass by the molar mass; moles to grams multiplies back, which is what you need to know how much powder to weigh. You can also get moles from a number of particles, from a solution of known concentration and volume, or from a gas using the ideal gas law.

The molar mass does not have to be looked up: type the chemical formula — H2O, Ca(OH)2, K4[Fe(CN)6] or a hydrate such as CuSO4·5H2O — and the calculator adds up the IUPAC standard atomic weights, then shows the mass percentage of each element. If you already know the molar mass, type it directly instead.

How to use this calculator

  1. Choose what to calculate: moles from mass, mass from moles, or moles from particles, a solution or a gas.
  2. Give the molar mass: type a formula (capital letters matter: Co is cobalt, CO is carbon monoxide) or switch to Value and enter it in g/mol.
  3. Enter the known quantity: a mass (µg to kg, ounces or pounds), an amount in mol, a number of particles (6.022e23 notation works), a concentration and volume, or a gas pressure, volume and temperature.
  4. Read the amount in moles (or the mass), plus millimoles, the number of particles and the composition of the compound. Open the steps to see each multiplication.

The formula

The four routes to an amount of substance nn (in mol):

n=mMn=NNAn=C⋅Vn=PVRTn = \frac{m}{M} \qquad n = \frac{N}{N_A} \qquad n = C \cdot V \qquad n = \frac{PV}{RT}
  • mm is the mass in grams and MM the molar mass in g/mol, so m=n⋅Mm = n \cdot M for the reverse conversion.
  • NA=6.02214076×1023 mol−1N_A = 6.02214076 \times 10^{23}\ \text{mol}^{-1} exactly (SI, 2019).
  • CC is the molar concentration in mol/L and VV the volume in litres.
  • PP in pascals, VV in m³, TT in kelvins (T=θ+273.15T = \theta + 273.15) and R=8.314462618 J mol−1 K−1R = 8.314462618\ \text{J mol}^{-1}\,\text{K}^{-1}.

The molar mass is the sum of the atomic weights in the formula, each multiplied by its subscript:

M(Ca(OH)2)=40.078+2×(15.999+1.008)=74.092 g/molM(\text{Ca(OH)}_2) = 40.078 + 2 \times (15.999 + 1.008) = 74.092\ \text{g/mol}

Worked example

Grams to moles. Water has M=2×1.008+15.999=18.015M = 2 \times 1.008 + 15.999 = 18.015 g/mol. A 36.0 g sample therefore contains 36.0/18.01536.0 / 18.015 = 1.9983 mol, or about 1.203 × 10²⁴ molecules.

Moles to grams with a hydrate. Blue copper sulfate, CuSO4·5H2O, has a molar mass of 249.68 g/mol once the five waters of crystallisation are counted. To weigh out 0.250 mol you need 0.250×249.680.250 \times 249.68 = 62.42 g.

Counting atoms. A 5.00 g piece of copper wire holds 5.00/63.5465.00 / 63.546 = 0.07868 mol, that is 4.74 × 10²² atoms.

A gas. A 10.0 L flask of gas at 1 atm (101 325 Pa) and 25 °C (298.15 K) contains n=(101 325×0.0100)/(8.314462618×298.15)n = (101\,325 \times 0.0100) / (8.314462618 \times 298.15) = 0.4087 mol of gas. If it is carbon dioxide (M=44.009M = 44.009 g/mol), that is 17.99 g.

Grams to moles converter: why the molar mass matters

A mass on its own says nothing about how many particles you have: 10 g of hydrogen gas contains about sixteen times more molecules than 10 g of oxygen. Dividing by the molar mass puts every substance on the same footing. Conveniently, the molar mass in g/mol has the same numerical value as the relative molecular mass, so the atomic weights printed on the periodic table can be used directly.

The atomic weights used here are the 2021 standard atomic weights published by IUPAC’s Commission on Isotopic Abundances and Atomic Weights. For elements whose isotopic make-up varies in nature (hydrogen, carbon, oxygen, chlorine, sulfur and others) IUPAC gives an interval; the calculator uses the abridged conventional value recommended for everyday work, such as 1.008 for H and 35.45 for Cl. Results may differ slightly from older textbooks that used 1.0079 or 35.453 — far below the precision of an ordinary laboratory balance.

Writing formulas the calculator understands

You type Read as Molar mass
NaCl sodium chloride 58.44 g/mol
Ca(OH)2 calcium hydroxide 74.09 g/mol
Al2(SO4)3 aluminium sulfate 342.13 g/mol
K4[Fe(CN)6] potassium ferrocyanide 368.35 g/mol
CuSO4·5H2O copper(II) sulfate pentahydrate 249.68 g/mol
C6H12O6 glucose 180.16 g/mol

Square and curly brackets work like parentheses, and the dot of a hydrate can be typed as ·, a full stop or an asterisk. Subscripts can be typed as normal digits. Charges and state symbols such as (aq) are not part of a formula and should be left out.

Frequently asked questions

How do I convert grams to moles?

Divide the mass in grams by the molar mass in g/mol: n = m / M. For 9.0 g of water (18.015 g/mol), n = 9.0 / 18.015 = 0.50 mol. Choose “Moles from mass” and the calculator does the division for any formula.

How do I convert moles to grams?

Multiply the number of moles by the molar mass: m = n × M. Half a mole of sodium chloride (58.44 g/mol) weighs 29.22 g. This is the calculation to make before weighing a reagent.

What exactly is the Avogadro constant?

Since 20 May 2019 the mole is defined by fixing the Avogadro constant at exactly 6.02214076 × 10²³ per mole. One mole is therefore that number of specified entities, and the old definition based on 12 g of carbon-12 is now only very nearly true.

How do I count the water in a hydrate?

Add the waters to the formula after a dot, e.g. CuSO4·5H2O or CuSO4.5H2O. The five water molecules add 5 × 18.015 = 90.08 g/mol, so the hydrate weighs 249.68 g/mol against 159.60 g/mol for the anhydrous salt — water makes up about 36 % of the hydrate’s mass, so forgetting it is a classic mistake.

Why do I get a different molar mass from my textbook?

Older books used atomic weights such as 1.0079 for hydrogen or 35.453 for chlorine. IUPAC now publishes intervals for these elements and recommends conventional values such as 1.008 and 35.45. The differences are usually in the third or fourth decimal place.

Can I use the gas mode for any gas?

It applies the ideal gas law, which is accurate to about 1 % for most gases near room temperature and atmospheric pressure. At high pressure or very low temperature real gases deviate and a van der Waals or virial correction is needed.

Sources

Last updated:

More Chemistry calculators

People also use