Molar mass calculator
This molar mass calculator reads any chemical formula, including brackets and hydrates, and returns the molar mass (molecular weight) together with a table of every element: number of atoms, atomic weight, mass contribution and mass percent.
Molar mass calculator
Percent composition and mass of an element in a sample
How to use the molar mass calculator
Type a chemical formula in the first panel. The molar mass calculator parses it, counts the atoms of each element (multiplying through brackets and hydrate coefficients), multiplies each count by the standard atomic weight and adds everything up. You get the molar mass in g/mol, the formula written with proper subscripts, the number of atoms per formula unit and a table that shows the mass and mass percent of every element. For hydrates it also tells you what share of the molar mass is water. Open “Show the working” for the line-by-line sum that a lab report or exam answer needs.
The second panel answers the follow-up questions that come straight after a molar mass: how many grams of iron are in 100 g of Fe₂O₃, or how much fertilizer supplies 50 g of nitrogen? Leave the element blank and it lists the mass of every element in the sample. If you need to go from grams to moles or particles instead, use the Mole Calculator.
What is molar mass and what does a molar mass calculator add up?
The molar mass M of a substance is the mass of one mole of it, in grams per mole. It equals the sum of the atomic weights of all atoms in the formula:
Here ni is the number of atoms of element i in one formula unit and Ai its standard atomic weight. Because one atomic mass unit (u, or dalton) per particle corresponds to one gram per mole, the same number is the formula mass in u: a water molecule has a mass of 18.015 u and a mole of water weighs 18.015 g.
Molar mass, molecular weight and formula mass
These terms are used almost interchangeably, and a molecular weight calculator and a molar mass calculator give the same number. Strictly, molar mass has units of g/mol; molecular weight (relative molecular mass, Mr) is the same number without units; formula mass is the preferred term for ionic compounds such as NaCl, which form lattices rather than discrete molecules; and molecular mass is the mass of one molecule in u. All of them are calculated with the same sum.
Worked example: copper(II) sulfate pentahydrate
The default formula in the molar mass calculator is CuSO₄·5H₂O, the blue crystals used in many school labs. Count the atoms first: 1 Cu, 1 S, 4 + 5 = 9 O and 5 × 2 = 10 H. Then multiply by the atomic weights and add:
| Element | Atoms | Atomic weight (g/mol) | Mass (g/mol) | Mass % |
|---|---|---|---|---|
| Cu | 1 | 63.546 | 63.546 | 25.451 % |
| S | 1 | 32.06 | 32.060 | 12.841 % |
| O | 9 | 15.999 | 143.991 | 57.671 % |
| H | 10 | 1.008 | 10.080 | 4.037 % |
| Total | 21 | 249.677 | 100 % |
The molar mass is 249.68 g/mol. The anhydrous salt CuSO₄ accounts for 159.602 g/mol and the five waters for 5 × 18.015 = 90.075 g/mol, so the crystals are 36.08 % water by mass. Heating 10.0 g of the hydrate until it turns white should therefore lose 3.61 g of water, a common lab check of a hydrate’s formula.
Percent composition with the molar mass calculator
Percent composition is the mass percent of each element in a compound. It does not depend on the sample size, so it is a fingerprint of the formula. Example 3.10 in OpenStax Chemistry 2e, section 3.2 asks for the composition of aspirin, C₉H₈O₄. The molar mass calculator gives M = 180.159 g/mol and 60.00 % C, 4.476 % H and 35.52 % O, exactly the textbook answer.
With the second panel you can turn the percentages into masses. Hematite, Fe₂O₃, is 69.943 % iron, so 100 g of pure ore contains 69.94 g of Fe; to obtain 50 g of iron you would need 50 / 0.69943 = 71.49 g of Fe₂O₃. To go the other way, from measured percentages to a formula, use the Empirical Formula Calculator.
How the molar mass calculator reads formulas
| You type | Read as | Molar mass (g/mol) |
|---|---|---|
| H2O | 2 H, 1 O | 18.015 |
| Ca(OH)2 | 1 Ca, 2 O, 2 H (the bracket is multiplied by 2) | 74.092 |
| Al2(SO4)3 | 2 Al, 3 S, 12 O | 342.132 |
| (NH4)3PO4 | 3 N, 12 H, 1 P, 4 O | 149.087 |
| K4[Fe(CN)6] | 4 K, 1 Fe, 6 C, 6 N (nested brackets) | 368.345 |
| MgSO4·7H2O | MgSO₄ plus 7 H₂O (hydrate) | 246.466 |
| Na2CO3*10H2O | Na₂CO₃ plus 10 H₂O (* works like ·) | 286.138 |
| C2H5OH | 2 C, 6 H, 1 O (repeated elements are added) | 46.069 |
Element symbols are case-sensitive: the first letter is a capital and the second, if any, is lowercase. “CO” is carbon monoxide (28.010 g/mol) while “Co” is cobalt (58.933 g/mol). For an ion, type the neutral formula (SO4 for sulfate); the electrons add only about 0.00055 g/mol each. For a non-stoichiometric compound with a decimal subscript, put the decimal inside brackets, for example (Fe0.95)O, because a dot at the top level is read as a hydrate separator.
Standard atomic weights used by the molar mass calculator
Atomic weights come from the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW standard atomic weights). For elements whose isotopic composition varies in nature, such as hydrogen, carbon, oxygen and chlorine, IUPAC gives an interval and a single conventional value for everyday use; the calculator uses those conventional values. Some common ones:
| Element | Atomic weight | Element | Atomic weight |
|---|---|---|---|
| H | 1.008 | S | 32.06 |
| C | 12.011 | Cl | 35.45 |
| N | 14.007 | K | 39.098 |
| O | 15.999 | Ca | 40.078 |
| Na | 22.990 | Fe | 55.845 |
| Mg | 24.305 | Cu | 63.546 |
| Al | 26.982 | Zn | 65.38 |
| P | 30.974 | Ag | 107.87 |
Elements with no stable isotope, such as technetium, radon and the actinides after uranium, have no standard atomic weight. For these the molar mass calculator uses the mass number of the longest-lived isotope (for example 222 for radon) and flags the result as approximate. Textbooks that round atomic weights to two decimals (C 12.01, O 16.00) give answers that differ slightly in the last digit, for example 206.27 instead of 206.285 g/mol for ibuprofen, C₁₃H₁₈O₂.
Common mistakes a molar mass calculator catches
Not distributing a bracket subscript. In Ca(NO₃)₂ there are 2 N and 6 O, giving 164.086 g/mol, not 102 g/mol. Forgetting the water of a hydrate. Epsom salt, MgSO₄·7H₂O, is 246.47 g/mol; the anhydrous salt is only 120.36 g/mol. Weighing out a hydrate with the anhydrous molar mass gives a solution about half as concentrated as intended. Mixing up diatomic gases and atoms. Oxygen gas is O₂ at 31.998 g/mol. Rounding too early. Keep the atomic weights at full precision and round only the final answer; the molar mass calculator keeps three decimals in the table for this reason. Lowercase symbols. “nacl” cannot be read; write NaCl.
Where to use the molar mass next
The molar mass is the bridge between the balance and the mole. Divide a mass by it to get moles in the Mole Calculator, use it to weigh out a solution of known concentration in the Molarity Calculator, and feed it into reaction calculations in the Stoichiometry Calculator. Gas-phase work, such as finding a gas density, uses the same M in the Ideal Gas Law Calculator.
Related calculators
Start with the molar mass calculator, then convert to moles, find formulas from analysis data or set up a reaction calculation.
- Mole Calculator
- Empirical Formula Calculator
- Stoichiometry Calculator
- Molarity Calculator
- Average Atomic Mass Calculator
- Mole Fraction Calculator
- All chemistry calculators
Frequently asked questions
How do you calculate molar mass?
Multiply the number of atoms of each element in the formula by its atomic weight and add the products. For H₂SO₄: 2 × 1.008 + 32.06 + 4 × 15.999 = 98.072 g/mol.
Is molar mass the same as molecular weight?
Numerically, yes. Molar mass is expressed in g/mol, while molecular weight (relative molecular mass) is the same number without units. A molecular weight calculator and a molar mass calculator therefore give identical values.
How do I find the percent composition of a compound?
Divide the mass contribution of each element (atoms × atomic weight) by the molar mass and multiply by 100. The table under the result lists the mass % of every element automatically.
How do I enter a hydrate?
Separate the water with a dot, a middle dot or an asterisk: CuSO4.5H2O, CuSO4·5H2O and CuSO4*5H2O all give 249.677 g/mol. The result also shows what percentage of the mass is water of hydration.
Why does my textbook give a slightly different molar mass?
Books often round atomic weights (O = 16.00, C = 12.01) or use older IUPAC values. Differences in the second decimal place are normal and do not affect answers given to three or four significant figures.
Is this molar mass calculator free?
Yes. It runs in your browser, needs no sign-up and keeps no record of the formulas you enter.