← Home

⚗️ Molecular Weight Calculator

Enter a chemical formula like H2O or CaCO3 and get the molecular weight, molar mass and element composition instantly. Runs fully offline.

Use correct element case: NaCl, not Nacl. Use · or . for hydrates.

What is this tool?

Molecular weight (also called molecular mass or molar mass when expressed in grams per mole) is the sum of the atomic weights of every atom in a molecule. It tells you how heavy one molecule is relative to the carbon-12 standard, and — more practically — how many grams of a substance make up one mole (6.022 × 10²³ particles). This number is the bridge between the microscopic world of atoms and the macroscopic world of laboratory scales. This calculator takes any valid chemical formula and computes its molecular weight instantly. It understands element symbols with lowercase letters (like Na, Cl, Fe), handles subscripts written as plain numbers (H2O, CaCO3), supports parentheses with multipliers like Ca(OH)2, and even handles hydration water such as CuSO4·5H2O. The result includes the total molecular weight in g/mol, plus a breakdown of each element's mass and percentage composition. Everything runs locally in your browser — formulas never leave your device, no account is needed, and results appear instantly. This tool is ideal for chemistry students checking homework, lab technicians preparing solutions, and researchers calculating stoichiometry.

For related calculations, try the pH calculator, the LCM & GCD calculator and the scientific calculator to explore more useful tools.

How it works

The calculator parses the formula from left to right, tracking element symbols and their counts. Each element's atomic weight is looked up from the periodic table and multiplied by its subscript, then all contributions are summed. For example, H2O contains 2 hydrogen atoms (2 × 1.008 = 2.016) and 1 oxygen atom (15.999), giving a total of 18.015 g/mol. Parentheses are handled with a stack: a multiplier after a closing parenthesis (like the 2 in Ca(OH)2) scales every element inside that group. Hydration water is handled by treating the ·nH2O suffix as an additional H2O contribution, which is standard for hydrates. Beyond the total weight, the tool reports the mass percentage of each element — the mass of that element divided by the total mass, times 100. This percentage composition is the key to empirical formula problems and to converting between mass and moles in stoichiometry: mass ÷ molar mass = number of moles, a derived quantity the tool helps you calculate.

Simple Molecule Structures

Ball-and-stick representations of common molecules (H₂O, CO₂, NH₃).

H₂OOHHCO₂COONH₃NHHH

Common Molecular Weights Reference

Molecular weights of compounds frequently encountered in chemistry courses and labs.

CompoundFormulaMolar mass (g/mol)
WaterH2O18.015
Carbon dioxideCO244.009
AmmoniaNH317.031
Hydrochloric acidHCl36.458
Sulfuric acidH2SO498.072
Sodium chlorideNaCl58.440
Calcium carbonateCaCO3100.086
GlucoseC6H12O6180.156
EthanolC2H5OH46.069

Atomic Weights of Common Elements

Standard atomic weights used by this calculator (rounded to 3 decimal places).

ElementSymbolAtomic weight
HydrogenH1.008
CarbonC12.011
NitrogenN14.007
OxygenO15.999
SodiumNa22.990
SulfurS32.06
ChlorineCl35.45
CalciumCa40.078
IronFe55.845
Ad

How to use

  1. Type the chemical formula (e.g. H2O, CaCO3, or CuSO4·5H2O).
  2. Click Calculate.
  3. Read the molecular weight in g/mol.
  4. Review the element-by-element mass breakdown.
  5. Use the percentage composition for stoichiometry work.

Frequently Asked Questions

What is the difference between molecular weight and molar mass?

Molecular weight is the sum of atomic weights of all atoms in a molecule (a dimensionless number). Molar mass is the same value expressed in grams per mole (g/mol). They are numerically identical, which is why the terms are often used interchangeably.

Does the calculator handle hydrates?

Yes. Formulas like CuSO4·5H2O are supported — the water of hydration is added as 5 H2O units. Use the · symbol or a dot between the salt and the water.

Can I use parentheses?

Yes. Parentheses group atoms, and a subscript after the closing parenthesis multiplies the whole group, such as Ca(OH)2 or Al2(SO4)3.

What atomic weight values does it use?

The tool uses standard atomic weights from the IUPAC periodic table, rounded to three decimal places for readability. These match the values printed on most periodic tables used in classrooms.

Why does my formula not parse?

The most common issues are: using the wrong case for element symbols (write NaCl, not Nacl), spaces inside the formula, or an element symbol that does not exist. Check these before retrying.

How do I convert between mass and moles?

Use the relationship: moles = mass (g) ÷ molar mass (g/mol). For example, 36.03 g of water ÷ 18.015 g/mol = 2.00 mol of water. The tool's molar mass output feeds directly into this calculation.

Tips & Advice

Always capitalise the first letter of each element and use lowercase for the second letter — write NaCl, not NACL, since Na (sodium) is not the same as N (nitrogen) plus a. Use parentheses for polyatomic ions repeated more than once, like Ca(OH)2, and use the · symbol (or a dot) for hydrates: CuSO4·5H2O. For molarity calculations, remember that molarity (mol/L) equals mass in grams divided by molar mass, then divided by volume in litres. Rounding the atomic weights to 3 decimal places is fine for most lab work, but use full precision for analytical chemistry. When checking homework answers, beware of common errors: missing subscripts (writing OH instead of OH− groups), and confusing the molecular weight of a compound with the atomic weight of a single element.

Related Tools

Sources & References

  1. IUPAC. Standard Atomic Weights of the Elements. iupac.qmul.ac.uk.
  2. NIST. Atomic Weights and Isotopic Compositions. nist.gov.

Last reviewed: August 2026.

Limitations

This tool calculates molecular weights using standard IUPAC atomic weights rounded to three decimal places. It is intended for educational and general laboratory use.

What this tool does not account for:

For analytical work requiring exact masses, consult the full IUPAC isotopic data.

Ad