⚗️ 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₃).
Common Molecular Weights Reference
Molecular weights of compounds frequently encountered in chemistry courses and labs.
| Compound | Formula | Molar mass (g/mol) |
|---|---|---|
| Water | H2O | 18.015 |
| Carbon dioxide | CO2 | 44.009 |
| Ammonia | NH3 | 17.031 |
| Hydrochloric acid | HCl | 36.458 |
| Sulfuric acid | H2SO4 | 98.072 |
| Sodium chloride | NaCl | 58.440 |
| Calcium carbonate | CaCO3 | 100.086 |
| Glucose | C6H12O6 | 180.156 |
| Ethanol | C2H5OH | 46.069 |
Atomic Weights of Common Elements
Standard atomic weights used by this calculator (rounded to 3 decimal places).
| Element | Symbol | Atomic weight |
|---|---|---|
| Hydrogen | H | 1.008 |
| Carbon | C | 12.011 |
| Nitrogen | N | 14.007 |
| Oxygen | O | 15.999 |
| Sodium | Na | 22.990 |
| Sulfur | S | 32.06 |
| Chlorine | Cl | 35.45 |
| Calcium | Ca | 40.078 |
| Iron | Fe | 55.845 |
How to use
- Type the chemical formula (e.g. H2O, CaCO3, or CuSO4·5H2O).
- Click Calculate.
- Read the molecular weight in g/mol.
- Review the element-by-element mass breakdown.
- 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
pH Calculator
Convert between pH and hydrogen ion concentration instantly. Enter [H+] to get p
LCM & GCD Calculator
Free online LCM and GCD calculator. Find the least common multiple and greatest
Factorial Calculator
Free online factorial calculator. Compute the factorial of any non-negative inte
Exponent Calculator
Calculate exponents and powers instantly. Enter a base and an exponent to comput
Scientific Calculator
Use our free online scientific calculator for trigonometry, logarithms, exponent
Ratio Calculator
Simplify ratios, scale ratios up or down, and solve ratio proportions. Free onli
Sources & References
- IUPAC. Standard Atomic Weights of the Elements. iupac.qmul.ac.uk.
- 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:
- Isotopic variations: atomic weights are standard terrestrial averages; isotope-specific calculations require different data.
- Charged species: the calculator ignores charge symbols (+/−) in formulas such as SO4^2−, which is fine for weight but does not model ionic behaviour.
- Polymer and complex mixtures: molar mass distributions of polymers are not single values and are outside this tool's scope.
For analytical work requiring exact masses, consult the full IUPAC isotopic data.