Molar mass, percent composition and grams ⇄ moles for any chemical formula.
Handles brackets and hydrates. Results update as you type.
Grams per mole of the formula unit.
| Element | Atoms | Atomic mass | Mass (g/mol) | Mass percent |
|---|
Type in any box; the others update using the molar mass above.
Click an element to add it to the formula. Elements in your formula are highlighted.
The molar mass of a compound is the sum of the atomic masses of all atoms in its formula, expressed in grams per mole. For sulfuric acid, H₂SO₄: 2 × 1.008 (H) + 1 × 32.06 (S) + 4 × 15.999 (O) = 98.072 g/mol. Brackets multiply everything inside them, so Ca(OH)₂ counts 1 Ca, 2 O and 2 H.
For a hydrate such as CuSO₄·5H₂O, the dot means the water is added to the salt: 159.602 + 5 × 18.015 = 249.677 g/mol. The calculator shows the anhydrous part and the water separately, along with the percentage of water.
Element symbols are case sensitive: Co is cobalt but CO is carbon monoxide. Use ( ), [ ] or { } for groups, and a dot, ·, * or . between a salt and its water of crystallisation. A number directly before a part, such as 5H2O, multiplies that part. Write ions with ^ if you need to, such as SO4^2-; the charge is ignored because an electron’s mass is negligible.
Atomic weights are measured values that IUPAC revises from time to time, and some elements (like hydrogen, carbon and oxygen) vary a little in nature. This tool uses the current IUPAC conventional values, so H₂SO₄ comes out at 98.072 while older tables give 98.079. For exams, use the rounded option if your syllabus uses whole-number masses. For elements with no stable isotope, the mass number of the most stable isotope is used.
Values below use IUPAC atomic weights and are rounded to three decimals.
| Formula | Name | Molar mass (g/mol) |
|---|---|---|
| H2O | Water | 18.015 |
| CO2 | Carbon dioxide | 44.009 |
| NaCl | Sodium chloride (table salt) | 58.440 |
| H2SO4 | Sulfuric acid | 98.072 |
| HCl | Hydrochloric acid | 36.458 |
| HNO3 | Nitric acid | 63.012 |
| NaOH | Sodium hydroxide | 39.997 |
| KOH | Potassium hydroxide | 56.105 |
| CaCO3 | Calcium carbonate | 100.086 |
| NaHCO3 | Sodium bicarbonate (baking soda) | 84.006 |
| Na2CO3 | Sodium carbonate | 105.988 |
| C6H12O6 | Glucose | 180.156 |
| C12H22O11 | Sucrose | 342.297 |
| C2H5OH | Ethanol | 46.069 |
| CH4 | Methane | 16.043 |
| NH3 | Ammonia | 17.031 |
| O2 | Oxygen gas | 31.998 |
| N2 | Nitrogen gas | 28.014 |
| H2 | Hydrogen gas | 2.016 |
| Ca(OH)2 | Calcium hydroxide (slaked lime) | 74.092 |
| KMnO4 | Potassium permanganate | 158.032 |
| Fe2O3 | Iron(III) oxide | 159.687 |
| Al2O3 | Aluminium oxide | 101.960 |
| MgO | Magnesium oxide | 40.304 |
| CuSO4 | Copper(II) sulfate | 159.602 |
| CuSO4·5H2O | Copper(II) sulfate pentahydrate (blue vitriol) | 249.677 |
| (NH4)2SO4 | Ammonium sulfate | 132.134 |
| H3PO4 | Phosphoric acid | 97.994 |
| CH3COOH | Acetic acid | 60.052 |
| C6H6 | Benzene | 78.114 |
| C3H8 | Propane | 44.097 |
| C8H18 | Octane | 114.232 |
| KCl | Potassium chloride | 74.548 |
| AgNO3 | Silver nitrate | 169.872 |
| CaCl2 | Calcium chloride | 110.978 |
| MgSO4·7H2O | Magnesium sulfate heptahydrate (Epsom salt) | 246.466 |
| H2O2 | Hydrogen peroxide | 34.014 |
| CaO | Calcium oxide (quicklime) | 56.077 |
| NH4Cl | Ammonium chloride | 53.489 |
| K2Cr2O7 | Potassium dichromate | 294.182 |
| Na2SO4 | Sodium sulfate | 142.036 |
| CO | Carbon monoxide | 28.010 |
| SO2 | Sulfur dioxide | 64.058 |
| NO2 | Nitrogen dioxide | 46.005 |
| CH3OH | Methanol | 32.042 |
| C2H4 | Ethylene | 28.054 |
| C2H2 | Acetylene | 26.038 |
| Al2(SO4)3 | Aluminium sulfate | 342.131 |
| Ca3(PO4)2 | Calcium phosphate | 310.174 |
| FeSO4·7H2O | Iron(II) sulfate heptahydrate | 278.006 |
| Na2S2O3 | Sodium thiosulfate | 158.097 |
| O3 | Ozone | 47.997 |
Everything is calculated in your browser. Nothing you type is uploaded or stored.
Multiply the atomic mass of each element by the number of its atoms in the formula and add the results. For H₂O: 2 × 1.008 + 15.999 = 18.015 g/mol.
18.015 g/mol (using IUPAC atomic weights), or 18 g/mol if you use rounded textbook values.
They have the same number. Molar mass is in grams per mole (g/mol), while molecular weight (or formula mass) is a relative value in atomic mass units (u) and has no unit when written as a ratio. For ionic compounds like NaCl, the term formula mass is more accurate than molecular mass.
Add the molar mass of the salt to the water multiplied by the number of water molecules: 159.602 + 5 × 18.015 = 249.677 g/mol. Enter it with a dot, a star or a full stop, for example CuSO4·5H2O or CuSO4*5H2O.
Divide the mass in grams by the molar mass: moles = grams ÷ molar mass. For 36 g of water, 36 ÷ 18.015 ≈ 2.0 mol. The converter on this page does it in either direction and also gives the number of particles using Avogadro’s number, 6.022 × 10²³.
It is the share of the total mass contributed by each element: (mass of the element in one mole ÷ molar mass) × 100. The table shows it for every element in your formula, which is a common exam question.
Symbols are case sensitive and start with a capital letter. “co” and “Co” are not the same as “CO”, and “NACL” is not valid; write NaCl. The tool suggests a corrected spelling when it can.
By default, the IUPAC standard (conventional) atomic weights, for example H = 1.008, C = 12.011, O = 15.999 and Cl = 35.45. The rounded option uses the whole-number values taught in many schools, such as H = 1, C = 12, O = 16, Na = 23 and Cl = 35.5.
Yes, for any formula you can type, such as C6H12O6 or C8H18. Condensed formulas like CH3COOH work too, because repeated letters are added together. It cannot read structural drawings or names such as “glucose”.
Yes, it is free, runs in your browser and needs no sign-up.