Molar Mass Calculator
This molar mass calculator determines the molecular weight of any compound directly from its chemical formula, using standard IUPAC atomic weights. Molar mass, expressed in grams per mole (g/mol), is the bridge between the mass you can weigh on a balance and the number of molecules that chemistry equations are written in. Almost every quantitative chemistry calculation begins here: to find how many moles of a substance you have, you divide its mass in grams by its molar mass; to find how many grams you need of a given number of moles, you multiply. You type in the chemical formula using standard notation and the calculator adds up the atomic weight of every atom it contains. Element symbols must use correct capitalisation: a capital first letter and a lower-case second letter where applicable, such as Na for sodium, Cl for chlorine, or Mg for magnesium. Subscript numbers are written as ordinary digits, so water is H2O and glucose is C6H12O6. Brackets are fully supported for grouped units, meaning calcium hydroxide is Ca(OH)2 and aluminium sulfate is Al2(SO4)3. The built-in element table covers hydrogen through uranium and includes all elements commonly encountered in general, organic, and inorganic chemistry coursework. The result updates instantly as you type. Try H2O to get 18.02 g/mol, or C6H12O6 to get 180.16 g/mol, which are the two worked examples shown below. The calculator is intended for educational use and double-checking calculations; always verify critical values against authoritative sources for professional or laboratory work.
Capitalise element symbols correctly: H, He, Li, Na, Cl, Ca, Fe, etc. Brackets are supported: Ca(OH)2, Al2(SO4)3. If the formula is invalid the result shows "check the formula".
How it works
The calculator parses the formula character by character. When it reads a capital letter it starts a new element symbol, adds a lower-case letter if the next character is one, then looks up that symbol in the atomic weight table. Any digits that follow are the count of that atom; if there are none, the count is 1. Brackets cause the calculator to parse the enclosed group recursively and then multiply its total mass by the number following the closing bracket. All the partial masses are added together to give the molar mass in g/mol.
Worked example
Water is H2O. The calculator finds two hydrogen atoms at 1.008 g/mol each (2.016 total) plus one oxygen atom at 15.999 g/mol, for a total of 18.015 g/mol, displayed as 18.02 g/mol. Glucose is C6H12O6: six carbons at 12.011 (72.066) plus twelve hydrogens at 1.008 (12.096) plus six oxygens at 15.999 (95.994) gives 180.16 g/mol.
Related calculators
- Moles Calculator: convert between moles, mass, and molar mass.
- Molarity Calculator: solve M=n/V for solution concentration.
- Dilution Calculator: work out stock and diluent volumes using C1V1=C2V2.
- Percent Error Calculator: compare your calculated molar mass to a reference value.