Molecular Weight Calculator — From a Chemical Formula

Type a chemical formula and get its molecular weight. Parses element symbols and subscripts, including nested groups.

By Konstantin Iakovlev · Updated September 2026 · Source: IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW) — Abridged Standard Atomic Weights

Molecular Weight

18.015 g/mol

Element Breakdown

H × 22.016 g/mol
O × 115.999 g/mol

Use the Molecular Weight Calculator — From a Chemical Formula above to calculate your results. Enter your values and see instant results — all calculations run in your browser.

Disclaimer: This calculator is for informational purposes only. Results are estimates based on the information you provide and the assumptions described on this page.

How It Works

Molecular weight is the foundation for almost every quantitative task in chemistry, from weighing out a reagent in a research lab to dialing in a reaction on a manufacturing line, where a small error in mass can ripple into wasted material and off-spec product. The stakes are highest in pharmaceutical work, where the figure feeds directly into dosage calculations that affect patient safety and efficacy.

The tool reads a chemical formula by separating it into element symbols and their subscripts, expands groups in parentheses or brackets and hydrates written with a dot (CuSO4·5H2O), then looks each element up in a built-in table of about 55 common elements, from hydrogen to uranium, using the CIAAW (IUPAC) abridged standard atomic weights. A symbol missing from the table is reported rather than counted as zero. Multiplying every element's atomic weight by how many times it appears, and adding those products together, yields the molecular weight of the whole compound.

Capitalization carries meaning here: 'Co' is cobalt, while 'CO' is carbon monoxide, so the case of each letter changes the answer entirely. Parentheses matter too. 'Mg(OH)2' contains two hydroxyl groups, and an element written without a number, like oxygen in 'H2O', still carries an implied subscript of 1 that has to be counted.

Example: Calculating the Molecular Weight of Glucose

  1. 1 Input the chemical formula for glucose: C6H12O6.
  2. 2 The calculator identifies Carbon (C) with a subscript of 6, Hydrogen (H) with a subscript of 12, and Oxygen (O) with a subscript of 6. Using current atomic weights (C ≈ 12.011 g/mol, H ≈ 1.008 g/mol, O ≈ 15.999 g/mol), it calculates: (6 * 12.011) + (12 * 1.008) + (6 * 15.999).
  3. 3 72.066 + 12.096 + 95.994 = 180.156 g/mol, which is what the calculator shows.
  4. 4 This molecular weight is vital for biochemists determining concentrations in metabolic studies or for food scientists analyzing carbohydrate content.

Frequently Asked Questions

How do you calculate molecular weight from a formula?
Add the atomic weights of all atoms in the formula. For H₂O: (2 x 1.008) + (1 x 16.00) = 18.016 g/mol. For glucose C₆H₁₂O₆: (6 x 12.01) + (12 x 1.008) + (6 x 16.00) = 180.16 g/mol.
What is the difference between molecular weight and molar mass?
They are numerically identical but have different units. Molecular weight is measured in atomic mass units (amu) for a single molecule. Molar mass is in grams per mole (g/mol) for Avogadro's number of molecules.
Where do you find atomic weights for calculation?
Atomic weights are listed on the periodic table under each element symbol. Common values include H = 1.008, C = 12.011, N = 14.007, O = 15.999, and S = 32.06.