What the Molar Mass Calculator does
This molar mass calculator reads a chemical formula - H2SO4, Ca(OH)2, K4[Fe(CN)6] or a hydrate such as CuSO4.5H2O - and gives its molar mass in grams per mole, with the mass of every element, its percentage of the total, the working written out, and a converter between grams, moles and number of particles.
The atomic weights are the current standard atomic weights published by IUPAC's Commission on Isotopic Abundances and Atomic Weights (CIAAW), in their abridged five-figure form, with the 2024 revisions included. Because many textbooks and answer keys still use the older IUPAC 2005/2007 values, you can switch to those, or type your own value for any element, and see exactly how much the answer moves. The formula never leaves your browser.
How to use it
- Type the formula with a capital letter for each element: NaCl, C6H12O6, Mg3(PO4)2. Brackets of any kind can be nested, and Unicode subscripts such as H₂O are fine.
- For a hydrate or adduct, separate the parts with a middle dot, an asterisk or a full stop: CuSO4·5H2O, CuSO4*5H2O and CuSO4.5H2O all mean the same thing. A leading number multiplies the part after it.
- Read the molar mass at the top, the share of each element in the bar chart, and the element-by-element table with the atomic weight used for each.
- To convert, type a mass in grams or an amount in moles; the other is filled in, together with the number of formula units from the Avogadro constant.
- Open Atomic weights used to switch to the older textbook values or to set a custom value, for example the mass of a specific isotope.
Reading the results
Molar mass is the mass of one mole of the substance - 6.02214076 x 10^23 formula units - in grams. Numerically it equals the relative formula mass (molecular weight), which has no unit, so 98.072 g/mol for sulfuric acid also means a relative molecular mass of 98.072.
The uncertainty tile adds up the CIAAW uncertainties of the atoms, which is a deliberately cautious figure. It reflects natural variation in isotopic composition between real samples, not a flaw in the arithmetic, and it is why quoting more than three decimal places rarely means anything.
Mass percentages are the composition by mass: in water, oxygen is about 88.8% of the mass even though it is only one of the three atoms. These are the numbers you need for percent-composition and empirical-formula questions.
If your answer key differs from the result in the second or third decimal place, check which atomic weights it used. Sulfur, for example, was 32.065 in the 2007 table and is now 32.06 in the abridged table, which alone moves sulfuric acid from 98.078 to 98.072.
Worked example: sulfuric acid and copper(II) sulfate pentahydrate
H2SO4 has 2 hydrogen, 1 sulfur and 4 oxygen atoms. With the current abridged weights: 2 x 1.0080 = 2.016, plus 32.06, plus 4 x 15.999 = 63.996, which totals 98.072 g/mol. Sulfur is 32.06 / 98.072 = 32.69% of the mass.
With the older textbook values (H 1.00794, S 32.065, O 15.9994) the same sum is 2.01588 + 32.065 + 63.9976 = 98.07848, which rounds to 98.078 or 98.08 - the figure most answer keys print. The chemistry has not changed; the reference values have.
CuSO4·5H2O is CuSO4 plus five waters. CuSO4 is 63.546 + 32.06 + 63.996 = 159.602, and each H2O is 18.015, so five of them add 90.075, giving 249.677 g/mol (249.69 with the older values). 10 g of the blue crystals is therefore 10 / 249.677 = 0.0401 mol.
Formulas and scoring rules
- Molar mass
M = sum over elements of (number of atoms x standard atomic weight)Each part of a hydrate is added, multiplied by its coefficient. Each term is computed at nine-decimal precision before rounding, so no floating-point drift.- Mass percent of an element
% = (atoms x atomic weight) / M x 100- Moles from mass
n = m / M- Mass from moles
m = n x M- Number of formula units
N = n x 6.02214076 x 10^23The Avogadro constant has been exact since the 2019 redefinition of the SI.- Rounding
shown to 3 decimal places (and 2 in the tile), half away from zeroThe abridged atomic weights have five significant figures, so the third decimal place is the limit of what the data supports for most compounds.
Why the atomic weights change
A standard atomic weight is an average over the isotopes found in normal terrestrial material, and that mixture is not identical everywhere. Since 2009 CIAAW has given ten elements, including hydrogen, carbon, nitrogen, oxygen and sulfur, as intervals rather than single values, because their isotopic composition genuinely varies between sources. The abridged table on this page replaces each interval with a single conventional value suitable for everyday calculation.
This is why two correct calculators can disagree slightly. Neither is wrong; they use different editions of the reference data. For coursework, use the values your syllabus or data booklet specifies - the custom-weights box exists for exactly that.
Charges, isotopes and elements without a standard weight
Ion charges are read and ignored. Gaining or losing an electron changes the molar mass by about 0.00055 g/mol, which is smaller than the uncertainty of the atomic weights, so SO4^2- and SO4 give the same answer and the page says so.
Technetium, promethium and most elements beyond bismuth have no stable isotopes and therefore no standard atomic weight. The calculator will not invent one; enter the mass of the isotope you are working with, for example Tc=98, and it will use that.
Limitations: what the result does not prove
- It needs a molecular or empirical formula. It cannot read a chemical name such as "sodium bicarbonate", a SMILES string or a drawn structure.
- Isotopically labelled compounds (deuterated solvents, carbon-13 standards) are not recognised by symbol; set the isotope's mass as a custom weight for that element instead.
- The result is for normal terrestrial isotopic composition. Samples with unusual isotopic composition - certain minerals, enriched or depleted materials - can differ by more than the stated uncertainty.
- Exact (monoisotopic) masses used in mass spectrometry are a different quantity from molar mass and are not calculated here.
Privacy: where your data goes
Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics. Session recording and tag-manager scripts are switched off on this page.
Standards and sources
- CIAAW / IUPAC - Standard atomic weights of the elements - checked 19 Sep 2026
- CIAAW - Abridged Standard Atomic Weights (2024)
- IUPAC Gold Book - molar mass
- BIPM - The International System of Units (SI Brochure), mole and Avogadro constant
Frequently asked questions
How do you calculate molar mass from a chemical formula?
Multiply the atomic weight of each element by the number of its atoms in the formula and add the results. For water that is 2 x 1.0080 + 15.999 = 18.015 g/mol. Brackets multiply everything inside them, so in Ca(OH)2 there are two oxygen and two hydrogen atoms.
What is the molar mass of H2SO4?
98.072 g/mol with the current IUPAC abridged atomic weights, and 98.078 (usually printed 98.08) with the older 2007 values that many textbooks use. The difference comes almost entirely from sulfur, which went from 32.065 to 32.06.
How do I enter a hydrate like CuSO4.5H2O?
Type it with a dot, a middle dot or an asterisk between the parts: CuSO4.5H2O, CuSO4·5H2O or CuSO4*5H2O. The number after the dot multiplies the water, so five waters add 5 x 18.015 = 90.075 g/mol to the copper sulfate.
Is molecular weight the same as molar mass?
They have the same number but different units. Molar mass is in grams per mole; molecular weight (relative molecular mass) is a ratio to one twelfth of the mass of a carbon-12 atom and has no unit. For ionic compounds the term formula mass is used instead.
Why is my molar mass slightly different from my textbook?
Because atomic weights are revised as measurements improve, and textbooks and answer keys often use an older table. Switch to the older textbook values, or type the exact numbers from your data booklet as custom weights, and the result will match.
How do I convert grams to moles?
Divide the mass by the molar mass. 36.03 g of water divided by 18.015 g/mol is exactly 2 mol. Enter the grams in the Grams and moles section and the calculator does the division and also gives the number of molecules.
Does the calculator handle ions like SO4^2- or NH4+?
Yes. Write the charge at the end - SO4^2-, SO4 2-, NH4+ or Fe3+ - and it is recognised and ignored for the mass, with a note, because the electrons involved weigh far less than the precision of the atomic weights.
Last reviewed by the A2Z.Tools team against the sources listed above.