This free online molecular weight calculator instantly computes the molar mass of a chemical compound from its formula, including nested parentheses like Ca(OH)2. It shows a full element-by-element breakdown of each atom's contribution.
How to Use the Molecular Weight Calculator
- Type a chemical formula using standard element symbols and subscript numbers, such as H2O or C6H12O6.
- Use parentheses for grouped atoms with a multiplier, such as Ca(OH)2 or Mg3(PO4)2.
- Click "Calculate" to see the total molecular weight and a breakdown by element.
Worked Example: Glucose (C6H12O6)
The calculator counts the atoms of each element, multiplies each count by the element's standard atomic mass, and adds the results. For glucose:
| Element | Atoms | Atomic mass | Contribution (g/mol) |
|---|
| Carbon (C) | 6 | 12.011 | 72.066 |
| Hydrogen (H) | 12 | 1.008 | 12.096 |
| Oxygen (O) | 6 | 15.999 | 95.994 |
| Total | | | 180.156 |
|---|
The breakdown also gives mass percentages: carbon is 72.066 ÷ 180.156, or about 40.0% of glucose by mass. To weigh out 0.5 mol of glucose you need 0.5 × 180.156 = 90.078 g, and 9 g of glucose is 9 ÷ 180.156 ≈ 0.05 mol.
Molar Masses of Common Compounds
| Compound | Formula to enter | Result (g/mol) |
|---|
| Carbon dioxide | CO2 | 44.009 |
| Sodium chloride (common salt) | NaCl | 58.44 |
| Urea | CH4N2O | 60.056 |
| Calcium hydroxide (slaked lime) | Ca(OH)2 | 74.092 |
| Sulphuric acid | H2SO4 | 98.072 |
| Calcium carbonate (limestone, chalk) | CaCO3 | 100.086 |
| Copper sulphate pentahydrate (blue vitriol) | CuSO4(H2O)5 | 249.677 |
Values are based on the standard atomic masses stored in this site's periodic table data. Textbooks and reagent labels may round atomic masses differently, so expect small differences in the second or third decimal place.
Entering Formulas Correctly
- Capitalisation matters. Co is cobalt, while CO is carbon plus oxygen. Every element symbol starts with a capital letter, followed by a lowercase letter if it has two letters.
- Only round brackets are understood. Write square or curly brackets as round ones: K4[Fe(CN)6] becomes K4(Fe(CN)6).
- The dot used for water of crystallisation, as in CuSO4·5H2O, cannot be typed. Write the water as a bracketed group instead: CuSO4(H2O)5.
- Leave out ionic charges and state symbols such as (aq) or (s). For an ion, the mass of the lost or gained electrons is negligible, so the neutral formula gives practically the same result.
- A leading coefficient such as the 2 in 2H2O is not supported. Calculate one formula unit and multiply by hand.
Frequently Asked Questions
The tool parses your formula into individual elements and their atom counts, looks up each element's atomic mass, multiplies by its count, and adds up all the contributions to get the total molar mass in grams per mole (g/mol).
Water (H2O) has a molecular weight of about 18.015 g/mol: 2 hydrogen atoms (about 1.008 each) plus 1 oxygen atom (about 15.999). Try it yourself by entering H2O above.
Yes. Parenthesized groups with a trailing multiplier are supported, such as Ca(OH)2 (calcium hydroxide) or Mg3(PO4)2 (magnesium phosphate).
They have the same numerical value but different units. Molecular weight (relative molecular mass) is a ratio with no unit, or is expressed in atomic mass units for one molecule, while molar mass is the mass of one mole of the substance in grams per mole. Water is 18.015 in both cases.
Replace the dot with a bracketed group and put the number of water molecules after it: enter CuSO4(H2O)5. The calculator then adds five water molecules to the copper sulphate and gives 249.677 g/mol.