Molecular Weight Calculator
Calculate the molecular weight (molar mass) of any chemical formula. Enter a formula like H2O or Ca(OH)2 for an instant per-element breakdown in g/mol.
Updated 2026-06-14 · Free · No sign-up · Runs privately in your browser
| Element | Atomic weight | Atoms | Mass (g/mol) | % of mass |
|---|
How the Molecular Weight Calculator Works
This tool computes the molecular weight (also called molar mass or formula weight) of any chemical compound from its formula. Type a formula such as H2O, C6H12O6, or Ca(OH)2, and the calculator parses the element symbols, subscripts, and parentheses, then returns the total in grams per mole (g/mol) along with a per-element breakdown.
How to Use It
- Enter a chemical formula in the box. Use standard notation: element symbols start with a capital letter (
Na,Cl,Mg), subscripts are plain numbers (O2,H2), and groups use parentheses with a multiplier (Ca(OH)2). - The result updates instantly. No “calculate” button is needed.
- Read the total molar mass at the top and the per-element table below it, which shows the atomic weight, atom count, mass contribution, and percentage of the total mass for each element.
- Click one of the example chips (H₂O, CO₂, NaCl, and so on) to load a ready-made formula.
The Formula
Molar mass is simply the sum of the standard atomic weights of every atom in the formula:
Molar mass = Σ (atomic weight × number of atoms)
The calculator uses IUPAC standard atomic weights — the same averaged values on a periodic table — so its answers match a chemistry textbook.
Worked Example: Glucose (C6H12O6)
For glucose, count each element and multiply by its atomic weight:
- Carbon: 6 × 12.011 = 72.066
- Hydrogen: 12 × 1.008 = 12.096
- Oxygen: 6 × 15.999 = 95.994
Add them together:
72.066 + 12.096 + 95.994 = 180.156 g/mol
Why Molar Mass Matters
Knowing a compound’s molar mass lets you:
- Convert between grams and moles — moles = mass ÷ molar mass, the backbone of every stoichiometry problem.
- Prepare solutions of a known concentration — to make a 1 M solution you weigh out one molar mass in grams per litre.
- Balance reaction yields — comparing the molar masses of reactants and products gives the theoretical yield.
Common Molar Masses
| Compound | Formula | Molar mass (g/mol) |
|---|---|---|
| Water | H2O | 18.015 |
| Carbon dioxide | CO2 | 44.009 |
| Sodium chloride | NaCl | 58.44 |
| Glucose | C6H12O6 | 180.156 |
| Calcium hydroxide | Ca(OH)2 | 74.092 |
| Sulfuric acid | H2SO4 | 98.07 |
Frequently asked questions
What is the difference between molecular weight and molar mass?+
They are numerically identical for a given formula. Molecular weight (or molecular mass) is the sum of atomic weights in atomic mass units (amu) for one molecule, while molar mass is the same number expressed in grams per mole (g/mol). For water, the molecular weight is 18.015 amu and the molar mass is 18.015 g/mol.
How do I calculate molecular weight from a chemical formula?+
Multiply the standard atomic weight of each element by how many atoms of it appear in the formula, then add the results together. For glucose, C6H12O6, that is (6 × 12.011) + (12 × 1.008) + (6 × 15.999) = 180.156 g/mol.
How does the calculator handle parentheses like Ca(OH)2?+
The parser expands grouped atoms by the multiplier outside the bracket. For Ca(OH)2 it reads one calcium, then two oxygen and two hydrogen, giving 40.078 + 2 × (15.999 + 1.008) = 74.092 g/mol. Nested brackets and square or curly brackets are supported too.
What atomic weights does this calculator use?+
It uses the IUPAC standard (conventional) atomic weights for all 118 elements, the same values printed on a periodic table. These are weighted averages of an element's natural isotopes, which is why results match those from a chemistry textbook.
Can I calculate the molar mass of hydrates and ions?+
You can enter the full formula of a hydrate by writing out every atom, for example CuSO4 then a separate calculation for the water of crystallisation. The calculator computes the mass of the atoms you type; it does not add or subtract electron mass for ions, so an ion's molar mass equals its neutral formula mass to the precision shown.