Molecular Weight Calculator
Molecular weight, also referred to as molar mass, is the sum of the atomic weights of all atoms in a given chemical formula, expressed in grams per mole. A molecular weight calculator analyzes a chemical formula to compute its total molar mass by looking up the periodic table values of each constituent element. It supports complex expressions containing nested parentheses, sub-groups, and hydrate coefficients. Chemists, molecular biologists, and student researchers utilize these tools to convert between mass and moles during laboratory chemical synthesis.
Type a chemical formula and the calculator parses every element, sums the atomic weights, and returns molar mass in g/mol with a per-element mass and percent-composition breakdown.
Quick Answer
Determine the molar mass of any chemical compound. Type the chemical formula to calculate its molecular weight in grams per mole.
Element symbols are case-sensitive (Na, not NA). Subscripts are digits after the symbol. Parentheses with multipliers are supported. · e.g. H2O, CO2, NaCl, C6H12O6, Ca(OH)2
What this parser supports
- Element symbols from H (hydrogen) through Pu (plutonium).
- Numeric subscripts directly after a symbol, e.g. H2O.
- Parentheses and square brackets with numeric multipliers, e.g. Ca(OH)2 or Mg3(PO4)2.
- Nested groups, e.g. K3[Fe(CN)6].
Not supported: charge notation (e.g. NH4+), hydrate dots (CuSO4·5H2O), isotope labels, or organic shorthand (CH3 in Lewis structure form). Educational use only; do not rely on this for laboratory dosing or safety decisions.
Molecular weight of H2O
18.015 g/mol
3 atoms total
Molar mass equals the sum, over each element, of the atom count times the standard atomic weight. Values are the IUPAC 2021 conventional weights in g/mol. The percent column shows mass composition by element.
Examples
H2O (water)
18.015 g/mol
CO2 (carbon dioxide)
44.009 g/mol
NaCl (table salt)
58.44 g/mol
C6H12O6 (glucose)
180.156 g/mol
Ca(OH)2 (calcium hydroxide)
74.093 g/mol
K3[Fe(CN)6] (potassium ferricyanide)
329.244 g/mol
How it works
The parser walks the formula one symbol at a time, expanding any parenthesized group by its subscript and accumulating atom counts per element. Molar mass is then the sum, over every element, of count × atomic weight.
Molar mass · M = Σ n_i × A_i
n_i = atom count for element i, A_i = standard atomic weight (g/mol).
Percent composition for each element is mass(element) / mass(total) × 100, useful for converting between mass and moles and for stoichiometric ratios.
Related education calculators
- Empirical Formula
- Grams to moles calculator for the next stoichiometry step once you have the molar mass.
- Molarity calculator for solution concentration in mol/L.
- Percent yield calculator for actual-vs-theoretical reaction yield.
- Balancing equations calculator for finding chemical-equation coefficients.
- All education calculators.
Educational use only. The parser is built for homework and classroom problems. Do not use this output for laboratory dosing, drug formulation, chemical safety, or any decision where exact masses matter.
Related Calculators
More tools from Education



