Math calculator

Free molecular weight calculator

Calculate the molecular weight of any compound from its chemical formula — enter a formula like H₂O or C₆H₁₂O₆ to see the molar mass in g/mol, updated live, as you type.

InputsLive
Chemical Formula
Enter a chemical formula like H2O, NaCl, or C6H12O6
Result
Molecular weight
18.015 g/mol
H2O = 18.015 g/mol
FormulaH2O
Atoms recognized2
Molecular weight18.015 g/mol
Parsed elementsH×2=2.016, O×1=15.999

Molecular weight = sum of atomic masses × counts. Supports common elements.

Results are estimates. Consult a professional.

How it's calculated

How the molecular weight calculator works

Molecular weight (also called molar mass or formula weight) is the sum of the atomic weights of all atoms in a molecule's chemical formula, weighted by how many times each atom appears. Atomic weights come from the IUPAC periodic table — they are the relative atomic masses averaged over the natural isotopic distribution of each element. The result is expressed in grams per mole (g/mol), equal numerically to the unified atomic mass unit (u) per molecule.

MW = Σ (atomic weight of element × number of atoms in formula)
Common atomic weights (g/mol):
H = 1.008 C = 12.011 N = 14.007 O = 15.999
Na = 22.990 Cl = 35.453 Ca = 40.078 Fe = 55.845
Atomic weights are taken from the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), 2021 Table of Standard Atomic Weights.
Example

Worked example: water (H₂O) and carbon dioxide (CO₂)

Example: MW of H₂O and CO₂

Calculate the molecular weight of water (H₂O) and carbon dioxide (CO₂) — two of the most common molecules in chemistry and biology.

H₂O: 2 × H + 1 × O
= 2 × 1.008 + 1 × 15.999
= 2.016 + 15.999
= 18.015 g/mol
CO₂: 1 × C + 2 × O
= 1 × 12.011 + 2 × 15.999
= 12.011 + 31.998
= 44.009 g/mol
H₂O = 18.015 g/mol
Water is 18.015 g/mol. Carbon dioxide (CO₂) is 44.009 g/mol.
Quick reference

Atomic weights of common elements

These eight elements account for the vast majority of molecules encountered in organic chemistry, biochemistry, and introductory inorganic chemistry.

ElementSymbolAtomic numberAtomic weight (g/mol)
HydrogenH11.008
CarbonC612.011
NitrogenN714.007
OxygenO815.999
SodiumNa1122.990
ChlorineCl1735.453
CalciumCa2040.078
IronFe2655.845
PhosphorusP1530.974
SulfurS1632.06

Source: IUPAC 2021 standard atomic weights (CIAAW). Values rounded to 3 decimal places.

Practical tips

Tips for molecular weight calculations

Molecular weight is the gateway calculation for stoichiometry, solution preparation, and spectroscopy. Accurate results depend on reading the formula correctly.

  • Count subscripts carefully — In Ca(OH)₂, the subscript 2 applies to the whole group (OH): 1 Ca + 2 O + 2 H → 40.078 + 2(15.999) + 2(1.008) = 74.093 g/mol.
  • Use IUPAC atomic weights, not rounded integers — Rounded weights (e.g., H=1, O=16) introduce cumulative error in large molecules. Use at least 3 decimal places for accurate molar mass.
  • Distinguish molecular weight from molecular formula weight — Molecular weight refers to individual molecules (in u); molar mass is the same number in g/mol. For most lab purposes they are used interchangeably.
  • Water of crystallisation — Hydrated salts include water molecules in the crystal lattice, written as a dot: CuSO₄·5H₂O. Include 5 × 18.015 = 90.075 g/mol for the five water molecules.
  • Online databases for complex molecules — For proteins, polymers, or unfamiliar organic structures, look up the molecular formula in PubChem or ChemSpider before computing MW by hand.
Accuracy & limits

Accuracy and limitations

The calculation is arithmetically exact for a given set of atomic weights. The underlying atomic weights themselves carry small uncertainties due to natural isotopic variation between geographic sources — for example, the atomic weight of lead (Pb) varies noticeably depending on geological origin. For natural samples, IUPAC publishes conventional atomic weights that cover the typical terrestrial range. For isotopically pure or enriched samples, use the precise mass of the specific isotope rather than the standard atomic weight.

Glossary

Key terms

The sum of the atomic weights of all atoms in a molecule's formula, expressed in unified atomic mass units (u) per molecule or grams per mole (g/mol).
The mass of one mole (6.022 × 10²³ entities) of a substance. Numerically equal to molecular weight but expressed in g/mol. Used for lab-scale calculations.
The weighted average mass of an element's naturally occurring isotopes, expressed in unified atomic mass units (u). Standardised by IUPAC.
Defined as exactly 1/12 of the mass of a carbon-12 atom. Also called a dalton (Da). 1 u = 1.66054 × 10⁻²⁷ kg.
Quantitative relationships between reactants and products in a chemical reaction. Molecular weights are essential for converting between mass and mole quantities.
The simplest whole-number ratio of atoms in a compound (e.g., CH₂O for glucose). The molecular formula (C₆H₁₂O₆) is a whole-number multiple of the empirical formula.
About

About this calculator

Part of our math calculators suite — explore all calculators.

Questions

Frequently asked questions about the free molecular weight calculator

A molecular weight calculator is a free online tool that helps you calculate molecular weight from a chemical formula. Sum of atomic weights × counts. It runs entirely in your browser with instant results and no sign-up.
JavaScript double-precision floating-point — accurate to about 15-17 significant digits. For arbitrary precision, use the Big Number calculator.
The statistics calculator computes population variance (divides by n). For sample variance, multiply variance by n/(n-1).

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.