
How to use the molar mass calculator

- Type a chemical formula. Symbols are case-sensitive, and brackets and hydrates work.
- Optionally enter an amount to convert between grams and moles.
- Choose the unit: grams, milligrams, kilograms, moles or millimoles.
- Read the molar mass in g/mol, then the mass percent of each element below.
Type a chemical formula and the molar mass appears in grams per mole, together with a table showing how many atoms of each element there are, each element's contribution and its mass percent. Element symbols are case-sensitive, exactly as on the periodic table: Co is cobalt, while CO is carbon monoxide.
Groups in round or square brackets are multiplied by the number after them, so Ca(OH)2 contains two O and two H, and K4[Fe(CN)6] contains six C and six N. For hydrates, separate the water with a dot, a star or a middle dot, as in CuSO4·5H2O or CuSO4*5H2O. A trailing charge such as SO4^2- is ignored, because electrons add almost no mass. Enter an amount in grams or moles to convert between them.
Molar mass formula
moles n = mass m ÷ M mass m = n × M
particles = n × NA, NA = 6.02214076 × 1023 mol−1
The molar mass in g/mol has the same number as the relative molecular mass (molecular weight) in atomic mass units, which is why the two terms are often used interchangeably.
Worked example: glucose
Glucose is C6H12O6.
- Carbon: 6 × 12.011 = 72.066
- Hydrogen: 12 × 1.008 = 12.096
- Oxygen: 6 × 15.999 = 95.994
- Total: 72.066 + 12.096 + 95.994 = 180.156 g/mol
Carbon makes up 72.066 ÷ 180.156 = 40.0% of the mass. A 10 g sample contains 10 ÷ 180.156 = 0.0555 mol, or about 3.34 × 1022 molecules.
Hydrate example
For CuSO4·5H2O, add the anhydrous salt and five waters: 63.546 + 32.06 + 4 × 15.999 = 159.602 for CuSO4, plus 5 × 18.015 = 90.075 for the water, for a total of 249.677 g/mol.
Molar masses of common compounds
| Compound | Formula | Molar mass (g/mol) |
|---|---|---|
| Water | H2O | 18.015 |
| Carbon dioxide | CO2 | 44.009 |
| Sodium chloride | NaCl | 58.440 |
| Sulfuric acid | H2SO4 | 98.072 |
| Calcium hydroxide | Ca(OH)2 | 74.092 |
| Glucose | C6H12O6 | 180.156 |
Atomic weight data
The calculator uses the standard atomic weights published by the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), including the 2024 revisions for gadolinium, lutetium and zirconium. Some elements, such as hydrogen, carbon and oxygen, have an interval rather than a single value because their isotope mix varies in nature. For those, the IUPAC abridged conventional values are used, for example 1.008 for hydrogen and 12.011 for carbon. Elements with no stable isotopes, such as technetium and radon, use the mass number of their longest-lived isotope.
Notes
Results are shown to three decimal places, which matches the precision of most textbook and laboratory work. Isotopically labeled compounds (for example deuterium, D) are not supported. Mass percent assumes the formula as written, so for a hydrate it includes the water.
Frequently asked questions
How do you calculate molar mass?
Multiply the number of atoms of each element by its atomic weight from the periodic table and add the results. For water, 2 × 1.008 + 15.999 = 18.015 g/mol.
What is the difference between molar mass and molecular weight?
Molar mass is the mass of one mole of a substance in g/mol. Molecular weight is the mass of one molecule in atomic mass units. They have the same numerical value.
How do I convert grams to moles?
Divide the mass in grams by the molar mass. For 36 g of water, 36 ÷ 18.015 = 2.0 mol. To go from moles to grams, multiply by the molar mass.
How do I enter a hydrate?
Put a dot, star or middle dot between the salt and the water, with the number of water molecules in front: CuSO4·5H2O, MgSO4*7H2O or CaCl2.2H2O.
Why are element symbols case-sensitive?
Because capital letters mark the start of each symbol. Co means cobalt, but CO means one carbon and one oxygen atom, and the two have very different masses.