Molecular weight calculator

Type a molecular formula to get its molecular weight (molar mass) in g/mol, with the mass percent of each element. Brackets and hydrates work: Ca(OH)2, [Cu(NH3)4]SO4, CuSO4·5H2O.

Examples

NNONON
Caffeine, C8H10N4O2
Cn1cnc2c1c(=O)n(C)c(=O)n2C
Open in the editor
OHOHOHOOHOH
Glucose, C6H12O6 (stereochemistry not shown)
OCC1OC(O)C(O)C(O)C1O
Open in the editor

How the molecular weight is calculated

The molecular weight is the sum of the standard atomic weights of all the atoms in the formula: for caffeine, C8H10N4O2, that is 8 × 12.011 + 10 × 1.008 + 4 × 14.007 + 2 × 15.999 = 194.19 g/mol. The atomic weights are the IUPAC (CIAAW 2021) conventional values that the Lone Pair editor uses, so this page and the editor’s Analyze panel give the same number. Sulfur and chlorine use 32.065 and 35.453, the values ChemDraw and RDKit use.

The mass percent of each element is its share of the molecular weight, the numbers used to check an elemental analysis (CHN) result.

Writing the formula

Element symbols start with a capital letter (Cl, not CL). A number after a symbol or a closing bracket multiplies it: Ca(OH)2 has two O and two H. A dot or a middle dot joins parts, and a number at the start of a part multiplies that part: CuSO4·5H2O is copper sulfate with five waters. Subscript digits (C₈H₁₀) are read too.

From a structure instead of a formula

If you have the structure rather than the formula, paste its SMILES or draw it in the editor and press Analyze: Lone Pair counts the atoms, including hydrogens, and gives the formula, the molecular weight and the exact mass.

What it does not do

Charges are not read: type the neutral formula, and use the editor for ion m/z values. It does not convert grams to moles yet; divide the mass by the molecular weight. Atomic weights are given for the elements common in chemistry; an element without a value here is reported, not guessed.

Questions

Is molecular weight the same as molar mass?

Numerically yes: the molecular weight in daltons (u) equals the molar mass in g/mol.

Why is my exact mass different from the molecular weight?

The exact (monoisotopic) mass uses the most abundant isotope of each element, not the average atomic weight. Use the exact mass calculator for mass spectrometry.

Which atomic weights are used?

IUPAC CIAAW 2021 conventional values, the same as the Lone Pair editor.

More tools

SMILES to structure · Structure to SMILES · Exact mass calculator · Name to structure

Lone Pair is a free chemical structure editor for journal-quality figures: draw molecules, reactions and mechanisms, open and save ChemDraw files, and get NMR, pKa and mass spectrum estimates. About Lone Pair · Privacy · Terms