How to use the molar mass calculator
Type a chemical formula exactly as it is written — H2O, Ca(OH)2, K4[Fe(CN)6] or a hydrate such as CuSO4·5H2O — and the molar mass appears as you type. Below it you get the element-by-element working (atoms × atomic mass), each element's share of the mass (percent composition), and a converter that turns grams into moles and number of particles, or moles back into grams. Copy the result with one click or share a link that opens the same formula.
Formulas are case-sensitive because element symbols are: Co is cobalt, CO is carbon monoxide, and NO is nitric oxide, not nobelium (No). Unicode subscripts (C₆H₁₂O₆) and charges (SO4^2-) are accepted.
What is molar mass?
The molar mass M of a substance is the mass of one mole of it, in grams per mole (g/mol). One mole is exactly 6.022 140 76 × 10²³ particles (the Avogadro constant, fixed in the 2019 SI). Numerically, the molar mass in g/mol equals the average mass of one molecule or formula unit in daltons (Da, also written u or amu), which is why "molecular weight", "formula weight" and "molar mass" give the same number.
How to calculate molar mass by hand
- Write the formula and count the atoms of each element. Brackets multiply everything inside: Ca(OH)₂ has 1 Ca, 2 O and 2 H.
- For a hydrate, add the water: CuSO₄·5H₂O has 5 extra H₂O, i.e. 10 H and 5 O.
- Multiply each count by the standard atomic weight from the periodic table.
- Add the products.
Example — glucose, C₆H₁₂O₆: 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 72.066 + 12.096 + 95.994 = 180.156 g/mol. Water: 2 × 1.008 + 15.999 = 18.015 g/mol. Carbon dioxide: 12.011 + 2 × 15.999 = 44.009 g/mol.
Percent composition
The mass percent of an element is its share of the molar mass: (atoms × atomic mass ÷ molar mass) × 100. In water, hydrogen is 2.016 ÷ 18.015 = 11.19 % and oxygen 88.81 %. The bar chart in the results table shows the split at a glance; reverse the process (percent → empirical formula) by dividing each percent by its atomic mass and scaling to whole numbers.
Grams, moles and particles
The three conversions every chemistry student needs: moles = grams ÷ molar mass, grams = moles × molar mass, and particles = moles × 6.022 × 10²³. 100 g of water is 100 ÷ 18.015 = 5.551 mol, or 3.343 × 10²⁴ molecules. Type either the grams or the moles in the converter and the other two update instantly.
Which atomic weights are used?
The calculator uses the IUPAC standard atomic weights (2021 abridged, conventional values for elements with ranges: H 1.008, C 12.011, N 14.007, O 15.999, Cl 35.45, S 32.06). These are the values printed in most textbooks and exam data sheets, so your answers will match the mark scheme. For radioactive elements without a stable isotope, the mass number of the longest-lived isotope is used (e.g. Tc 98, Pu 244). Deuterium (D) and tritium (T) are also accepted.
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 |
| Sodium hydroxide | NaOH | 39.997 |
| Hydrochloric acid | HCl | 36.458 |
| Sulfuric acid | H2SO4 | 98.072 |
| Glucose | C6H12O6 | 180.156 |
| Sucrose | C12H22O11 | 342.297 |
| Calcium carbonate | CaCO3 | 100.086 |
| Ammonia | NH3 | 17.031 |
| Oxygen gas | O2 | 31.998 |
| Nitrogen gas | N2 | 28.014 |
| Methane | CH4 | 16.043 |
| Ethanol | C2H5OH | 46.069 |
| Potassium permanganate | KMnO4 | 158.032 |
| Copper sulfate pentahydrate | CuSO4·5H2O | 249.677 |
| Calcium hydroxide | Ca(OH)2 | 74.092 |
| Nitric acid | HNO3 | 63.012 |
| Baking soda | NaHCO3 | 84.006 |
| Caffeine | C8H10N4O2 | 194.194 |
Tips and common mistakes
- Do not forget the subscript after a bracket: Mg(OH)₂ is 58.319 g/mol, MgOH would be wrong.
- Diatomic gases: oxygen gas is O₂ (31.998 g/mol), not O.
- Ions: removing or adding electrons changes the mass by only 0.00055 g/mol per electron, so Na⁺ and Na have the same molar mass for any practical purpose.
- Round at the end. Keep full precision through a multi-step calculation, then round with the significant figures calculator.
Next steps: balance the reaction with the chemical equation balancer (it also finds the limiting reagent), work out gas volumes with the ideal gas law calculator, or make solutions with the dilution calculator.