Mole Calculator — Grams, Moles and Molar Mass
Convert grams to moles, moles to grams, or work back to molar mass. n = m / M with IUPAC CIAAW 2024 atomic weights and every convention stated.
Mole Calculator
Background.
This mole calculator converts between the three quantities tied together by molar mass — mass in grams, amount of substance in moles, and molar mass in grams per mole — using the single defining relation n = m / M. Pick what you want to find, enter the two you know, and the calculator returns all four figures at once: moles, millimoles, mass and molar mass. It answers 'grams to moles', 'moles to grams', and the less-common but very useful reverse question, 'I weighed 5.844 g and I know it was 0.1 mol, so what is the molar mass?'
What this page assumes, stated up front rather than buried in an FAQ. There is no reference state. Unlike molarity, which needs a volume and therefore shifts with temperature through thermal expansion, and unlike the ideal gas law, which needs a stated pressure and temperature basis, n = m / M is a definitional identity between two extensive properties of one sample. It holds at 4 °C and at 400 °C, at one bar and at fifty, for a solid, a liquid or a gas. No STP, no SATP, no correction.
The approximation is not in the equation — it is in the number you type into the molar mass box. Standard atomic weights are abundance-weighted averages over normal terrestrial material. That makes them exactly right for ordinary reagents and exactly wrong for isotopically enriched or depleted ones: heavy water, a ¹³C-labelled internal standard, ⁶Li-depleted lithium metal and enriched ²³⁵U all need their own molar mass, not the periodic-table value. IUPAC's Commission on Isotopic Abundances and Atomic Weights publishes intervals rather than single values for more than a dozen elements — chlorine is [35.446, 35.457] because real chlorine varies measurably between sources — so a molar mass built from those elements carries genuine, irreducible uncertainty in its fourth significant figure.
Worked example, the one used throughout this page. Sodium chloride. From the CIAAW abridged 2024 table, sodium is 22.990 and chlorine is 35.45, so M(NaCl) = 22.990 + 35.45 = 58.440 g/mol, which is the 58.44 the USP monograph for Sodium Chloride prints on its header line. Weigh 5.844 g and you have n = 5.844 ÷ 58.44 = 0.100 000 mol, or 100 mmol. That is a decimal-exact case, which makes it a good one to check a calculator against.
The direction of the relationship, since it is the thing most often reversed by accident: molar mass sits in the denominator, so a heavier molecule means fewer moles for the same mass on the balance. Weigh 5.844 g of sodium chloride and you have 0.1 mol of it. Weigh 5.844 g of glucose, whose molar mass is 180.156 g/mol, and you have only 0.032 4386 mol — about a third as much substance for exactly the same reading on the balance. Mass tells you how heavy your sample is; moles tell you how many things are in it, and those are not the same question.
On precision. The calculator does no intermediate rounding at all: every step runs in arbitrary-precision decimal arithmetic and a single rounding to twelve significant digits happens on the way out. Twelve digits is a display convention, not a claim about your sample. The real precision of your answer is set by your balance and by the atomic-weight table — chlorine's ±0.01 out of 35.45 means a chloride salt's molar mass carries only about four significant figures of genuine information, no matter how many the screen shows.
Below the widget: the formal definition of the mole after the 2019 SI revision, why the molar mass of carbon-12 is no longer exactly 12 g/mol, how to read the calculator's error messages, and where each of the three singularities in this deceptively simple equation lives.
What is mole calculator?
Amount of substance, symbol n, is one of the seven SI base quantities, and the mole (mol) is its unit. The IUPAC Green Book defines molar mass as M_B = m / n_B — the mass of a sample divided by the amount of substance it contains — with the SI coherent unit kg mol⁻¹, though chemistry universally uses g mol⁻¹ because the numeric value in g/mol then equals the relative molecular mass. Rearranged, that definition is the whole of this calculator: n = m / M.
Since 20 May 2019 the mole has been defined by fixing a number rather than by reference to a kilogram of carbon. The BIPM SI Brochure states it directly: the mole is the SI unit of amount of substance, and one mole contains exactly 6.022 140 76 × 10²³ elementary entities. Avogadro's constant is therefore an exact integer count with no uncertainty, and the definition no longer mentions carbon-12 at all.
One consequence catches people out. Before 2019, the molar mass of carbon-12 was exactly 12 g/mol by definition. It no longer is. The molar mass constant M_u is now a measured quantity — CODATA 2022 gives 1.000 000 001 05(31) × 10⁻³ kg mol⁻¹ — so M(¹²C) = 12 × M_u = 12.000 000 0126(36) g/mol. The relative standard uncertainty is 3.1 × 10⁻¹⁰, which is ten orders of magnitude below the precision of any analytical balance and completely irrelevant at the bench, but it is real, and it is why the molar mass of an element is no longer, strictly speaking, numerically identical to its relative atomic mass.
Amount of substance is not a count of atoms, and this page is careful about the difference. A mole of water is 6.022 140 76 × 10²³ water molecules, which is 1.807 × 10²⁴ atoms, because each molecule has three of them. The Green Book is emphatic that the entity must always be specified — 'amount of oxygen' is ambiguous and should only be used where the context makes the entity clear. This calculator works purely in the mass-to-moles direction and never asserts a particle count; converting moles to atoms, molecules, ions or formula units is a separate step with its own factor, handled by the moles-to-atoms calculator.
How to use this calculator.
- Choose what you want to find from the first dropdown. 'Moles' is the grams-to-moles direction (n = m / M) and is the default. 'Mass' is the moles-to-grams direction (m = n × M), the one you use to decide what to weigh out. 'Molar mass' works backwards from a weighed mass and a known amount (M = m / n).
- Enter the molar mass in g/mol. Take it from the reagent bottle, the certificate of analysis, or a supplier datasheet. If you only have a chemical formula, get M from the molar mass calculator first — it parses formulas like Ca(OH)2 and returns g/mol.
- Enter the mass in grams and the amount in moles. The mode you chose decides which two are read; the third is ignored, so you can leave it at its default.
- Read all four results. The primary answer is the amount of substance in moles; millimoles is given alongside because bench-scale work is usually mmol, and the mass and molar mass are echoed so you can see exactly which numbers produced the answer.
- Sanity-check the direction. Heavier molecule, fewer moles for the same weighed mass — molar mass is in the denominator. If your answer moved the other way, the mass and molar mass boxes are probably swapped.
- For isotopically labelled or enriched material, do not use the periodic-table molar mass. Heavy water is 20.027 g/mol, not 18.015 g/mol — 2 × 2.01410177812 (NIST's relative atomic mass for deuterium) + 15.999. Type the isotopologue's own molar mass into the box.
- Treat the displayed digits as arithmetic, not measurement. Twelve significant digits come out; your real precision is whichever is worse, your balance or the atomic-weight uncertainty of the elements involved.
The formula.
The IUPAC Green Book (3rd ed., §2.10, p. 47) defines molar mass as M_B = m / n_B for an entity B. Every mode of this calculator is that one equation solved for a different letter:
n = m / M moles from a weighed mass m = n × M the mass to weigh out for a wanted amount M = m / n molar mass back-calculated from a weighing and a known amount
Dimensionally, [mass] ÷ [mass · amount⁻¹] = [amount]: grams divided by grams-per-mole leaves moles. That check is worth doing whenever a result looks odd, and it is enforced by a unit test — feeding milligrams together with mg/mmol returns the identical number, now read as millimoles, because the ratio is invariant under any consistent change of the mass unit.
Worked through with the page's fixture. Sodium chloride, from the CIAAW abridged 2024 table: M = A_r(Na) + A_r(Cl) = 22.990 + 35.45 = 58.440 g/mol. Weigh m = 5.844 g. Then n = 5.844 ÷ 58.44 = 0.100 000 mol = 100 mmol. Run it backwards: m = 0.1 × 58.44 = 5.844 g. Run it sideways: M = 5.844 ÷ 0.1 = 58.44 g/mol. All three modes close the loop exactly, which is the round-trip test in the test file.
ROUNDING STAGE — final only. There is exactly one rounding site in the module, and it is inside the return statement. No branch rounds before comparing, and no comparison anywhere in the code is made against a rounded value, so there is no threshold whose boundary can be crossed by rounding. The rounding is to twelve significant digits rather than to a fixed number of decimal places, on purpose: a fixed ten decimal places destroys legitimate results. One milligram of a 66 000 g/mol protein is 1.515 151 515 15 × 10⁻⁸ mol — about 15.15 nmol — which at ten decimal places would collapse to 0.000 000 015, two significant figures out of twelve.
SINGULARITIES — three of them, all refused rather than returned as infinity. Solving for moles or for mass with M = 0 is a division by zero with no physical referent, so the calculator rejects it and names the molar mass field. Solving for molar mass with n = 0 is the pole of M = m / n, likewise rejected. Solving for molar mass with m = 0 but n > 0 would imply massless matter, also rejected. One case that looks like an error and is not: a mass of exactly zero when solving for moles returns n = 0. An empty weighing boat contains zero moles, which is a perfectly good answer. Negative masses and negative amounts are refused outright rather than silently squared or made positive, and a result that would overflow double-precision range raises an error on the offending field instead of printing Infinity.
WHAT THIS PAGE DOES NOT DO. It does not parse chemical formulas — give it a number, not H2O; the molar mass calculator does the parsing. It does not convert moles to particle counts; that is the Avogadro bridge, N = n × N_A × (entities per formula unit), and it lives on the moles-to-atoms page because the entities-per-unit factor requires knowing the formula. And it does not involve volume, so it never needs a temperature or pressure basis.
A worked example.
Weighing out sodium chloride. You want to know how much substance is on the balance after weighing 5.844 g of NaCl. Step 1 — the molar mass. From the IUPAC CIAAW abridged standard atomic weights (2024 revision), sodium is 22.990 and chlorine is 35.45, so M(NaCl) = 22.990 + 35.45 = 58.440 g/mol. Cross-check against a completely separate authority: the USP monograph for Sodium Chloride prints 'NaCl 58.44' on its header line, and USP General Notices §8.40 states that the atomic weights used in computing its molecular weights are those established by the IUPAC commission. Two independent bodies, same number. Step 2 — the amount of substance. With solveFor set to 'Moles', mass = 5.844 g and molar mass = 58.44 g/mol, the calculator returns n = 5.844 ÷ 58.44 = 0.100 000 mol, and 100 mmol alongside it. This case is decimal-exact — 58.44 × 0.1 is exactly 5.844 — so it is a good one to test any calculator against. Step 3 — read it backwards. Switch the dropdown to 'Mass', enter 0.1 mol and 58.44 g/mol, and you get 5.844 g back: the number to weigh out. Switch to 'Molar mass', enter 5.844 g and 0.1 mol, and you get 58.44 g/mol. All three modes close the loop. The comparison that fixes the direction in your head. Weigh the same 5.844 g of glucose instead. Glucose is C6H12O6, so M = 6 × 12.011 + 12 × 1.0080 + 6 × 15.999 = 72.066 + 12.096 + 95.994 = 180.156 g/mol, and n = 5.844 ÷ 180.156 = 0.032 4386 mol. Identical reading on the balance, roughly a third as much substance, because molar mass divides. A second example from a different source. The standard physical-chemistry figure that pure water is about 55.5 mol per kilogram: M(H2O) = 2 × 1.0080 + 15.999 = 18.015 g/mol, so n = 1000 ÷ 18.015 = 55.5093 mol. Note the temperature basis, because it matters — 1000 g of water is one litre only near 4 °C. At 25 °C the density is 0.99705 g/cm³, so a litre weighs 997.05 g and contains 55.3455 mol. The familiar '55.5 M' is a 4 °C figure; at room temperature the honest number is 55.35 M.
Frequently asked questions.
How do I convert grams to moles?
Does the answer change with temperature or pressure?
Why is the molar mass of carbon-12 no longer exactly 12 g/mol?
Where does the molar mass number come from, and how accurate is it?
Can I use this for heavy water, ¹³C-labelled standards, or enriched uranium?
What does the calculator do at zero — division by zero, empty samples, negative numbers?
What is the difference between this and the molar mass calculator?
How do I get the number of atoms or molecules from moles?
Why does the calculator show twelve digits when my textbook rounds to three?
How do I use this to make up a solution of known concentration?
References& sources.
- [1]BIPM, The International System of Units (SI), 9th edition (2019) — definition of the mole, in force since 20 May 2019 following CGPM Resolution 1 (2018): 'The mole, symbol mol, is the SI unit of amount of substance. One mole contains exactly 6.022 140 76 x 10^23 elementary entities.' Open access, HTML; retrieved and verified 2026-07-29.
- [2]IUPAC, Quantities, Units and Symbols in Physical Chemistry ('Green Book'), 3rd edition, 2nd printing 2012, section 2.10 'General chemistry', p. 47 — defines molar mass M_B = m / n_B (SI unit kg mol^-1), amount of substance n_B = N_B / L, and relative atomic mass A_r = m_a / m_u; p. 53 requires that the elementary entity always be specified. Open-access searchable PDF; text-verified 2026-07-29.
- [3]IUPAC CIAAW, Abridged Standard Atomic Weights, 2024 revision (the 2021 technical report as revised for Gd, Lu and Zr in 2024) — the conventional single values used in this page's worked examples: Na 22.990(1), Cl 35.45(1), H 1.0080(2), O 15.999(1), C 12.011(2). Open access; retrieved and verified 2026-07-29.
- [4]IUPAC CIAAW, Standard Atomic Weights, 2024 revision — the interval-valued table for elements whose terrestrial isotopic composition varies: H [1.00784, 1.00811], Li [6.938, 6.997], C [12.0096, 12.0116], O [15.99903, 15.99977], Cl [35.446, 35.457]. Sodium is a point value, 22.98976928(2). Open access; retrieved and verified 2026-07-29.
- [5]NIST, CODATA 2022 recommended values of the fundamental physical constants — molar mass constant M_u = 1.000 000 001 05(31) x 10^-3 kg mol^-1 (relative standard uncertainty 3.1 x 10^-10), from which M(carbon-12) = 12 x M_u = 12.000 000 0126(36) g/mol; and the Avogadro constant N_A = 6.022 140 76 x 10^23 mol^-1, listed as exact. Open access; retrieved and verified 2026-07-29.
- [6]NIST Standard Reference Database 144 — 'Atomic Weights and Isotopic Compositions with Relative Atomic Masses'. Source of the nuclide masses quoted on this page: H-1 1.00782503223(9), H-2 (deuterium) 2.01410177812(12), from which heavy water's molar mass of 20.027 g/mol is derived. Open access; retrieved and verified 2026-07-29.
- [7]United States Pharmacopeia-National Formulary, General Notices and Requirements, section 8.40 'Atomic Weights': 'Atomic weights used in computing molecular weights and the factors in the assays and elsewhere are those established by the IUPAC Commission on Atomic Weights and Isotopic Abundances.' Consulted as the independent second authority for this page; the USP Sodium Chloride monograph header 'NaCl 58.44' agrees with the CIAAW-derived 22.990 + 35.45 = 58.440 g/mol used in the worked example. Open access PDF; text-verified 2026-07-29.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 682 calculators remain free
- No billing is enabled