Molar mass calculator

Type a chemical formula and get its molar mass in g/mol, the sum behind it and the mass percent of each element. Hydrates, brackets, decimals and charges are understood. Everything runs in your browser; nothing is uploaded.

Loading…

How to use the molar mass calculator

The molar mass of a compound is the sum of the atomic weights of its atoms, in grams per mole. Type a formula in the box above, for example NaCl (58.44 g/mol) or CuSO4·5H2O (249.68 g/mol). The headline gives the molar mass to two decimals, the table shows every element with its count, atomic weight, share of the mass and a bar, and the converter below it turns grams into moles and particles. Put one formula on each line to build a table of several compounds and download it as a CSV file. The address of the page keeps your formulas (molar-mass.html?f=NaCl), so you can send a calculation to a colleague.

Capital letters matter, because they separate the elements: Co is cobalt, CO is carbon monoxide. If a symbol cannot be read, the calculator points at the character it stopped on. The pages for common compounds, from NaCl and H2SO4 to copper sulfate pentahydrate, glucose and battery materials such as LiCoO2, give the answer without typing.

How to calculate molar mass

Count the atoms of each element in the formula, multiply each count by the atomic weight of that element, and add up. For sulfuric acid, H2SO4:

2 × H   =  2 × 1.008  =   2.016
1 × S   =  1 × 32.06  =  32.060
4 × O   =  4 × 15.999 =  63.996
                         ------
M(H2SO4)              =  98.072 g/mol  ≈ 98.07 g/mol

Brackets multiply everything inside them: in Ca(OH)2 there are two O and two H, so M = 40.078 + 2 × (15.999 + 1.008) = 74.09 g/mol. For a hydrate, add the water: CuSO4·5H2O is CuSO4 (159.60 g/mol) plus five waters (5 × 18.015 = 90.075 g/mol), 249.68 g/mol in total. To change between mass and amount use n = m / M: 10 g of NaCl is 10 / 58.44 = 0.1711 mol, which contains 0.1711 × 6.02214076 × 1023 = 1.030 × 1023 formula units.

What you can type

You typeIt means
Ca(OH)2Brackets with a multiplier; [ ] works the same and both can be nested, as in K4[Fe(CN)6]
LiNi0.8Mn0.1Co0.1O2Decimal counts
CuSO4·5H2O, CuSO4*5H2O, CuSO4.5H2OA hydrate or adduct: a dot, a star or a bullet, then a number and the formula of the water. With a plain full stop between digits, .5H2O is read as water; for any other adduct use · or *
2H2OA leading coefficient: the molar mass of two waters (36.03 g/mol)
SO4^2-, SO4{2-}, Fe3+, Cl-A charge, only at the very end. The mass of the electrons gained or lost is not counted
NaCl(s), H2O(l), CO2(g), Na+(aq)State labels are ignored
H₂O, Fe³⁺Unicode subscripts and superscripts, as copied from a paper or a slide

Where the atomic weights come from

The atomic weights are the abridged standard atomic weights of the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), 2024 edition (the 2021 table with the 2024 revisions for gadolinium, lutetium and zirconium), from ciaaw.org. Some elements, such as lithium, boron, carbon and sulfur, have an atomic weight that depends a little on where the sample came from; for these the table gives the conventional value, which is what textbooks and suppliers use. Elements that have no stable isotope (technetium, promethium, and everything from polonium to oganesson except thorium, protactinium and uranium) have no standard atomic weight: the calculator uses the mass number of the longest-lived isotope, as the IUPAC periodic table prints it in brackets, and tells you when it did so.

The results can differ from another calculator in the third decimal place when it uses an older atomic weight table. Results are rounded to two decimals in the headline and three in the table, and this precision is more than a balance in a teaching or research lab can use.

Frequently asked questions

What is molar mass?

The molar mass of a substance is the mass of one mole of it, in grams per mole (g/mol). For a compound it is the sum of the atomic weights of all the atoms in its formula. Water, H2O, has a molar mass of 18.015 g/mol.

How do I calculate the molar mass of a compound?

Write down how many atoms of each element the formula contains, multiply each count by that element's atomic weight, and add the results. For sulfuric acid, H2SO4: 2 x 1.008 + 32.06 + 4 x 15.999 = 98.072, so 98.07 g/mol. The calculator shows this sum for any formula.

How do I enter a hydrate such as CuSO4·5H2O?

Put the water after a dot: CuSO4·5H2O, CuSO4*5H2O and CuSO4.5H2O all work. The number in front of H2O multiplies the whole water molecule, so CuSO4·5H2O has 10 hydrogen and 9 oxygen atoms in total, and its molar mass is 249.68 g/mol.

Can I use decimal subscripts, as in LiNi0.8Mn0.1Co0.1O2?

Yes. Counts may be decimals, which is how battery cathodes, perovskites and doped oxides are written. LiNi0.8Mn0.1Co0.1O2 (NMC 811) comes to 97.28 g/mol.

Which atomic weights does the calculator use?

The abridged standard atomic weights of the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), 2024 edition. For elements whose weight varies between samples, such as lithium and sulfur, these are the conventional values. Elements without a stable isotope use the mass number of their longest-lived isotope.

How do I convert grams to moles?

Divide the mass in grams by the molar mass: n = m / M. For 10 g of NaCl, 10 / 58.44 = 0.1711 mol. Type the mass into the converter under the result and the amount in moles and the number of particles appear.

What is the difference between molar mass, molecular weight and formula mass?

Numerically they are the same for a given formula. Molar mass is in g/mol, while molecular weight and formula mass are relative values with no unit (or in atomic mass units). Formula mass is the usual term for ionic solids such as NaCl, which do not form separate molecules.

Are my formulas uploaded?

No. The calculation runs in your browser and nothing you type is sent to a server.

Balancing a reaction as well? The chemical equation balancer uses the same formula reader and atomic weights, and links each species back here.

More free tools for materials scientists: all free tools.