Skip to content
Calculator Collection

Molecular Weight Calculator

Compute the molecular weight (molar mass, g/mol) of a CHON-containing molecule from the number of carbon, hydrogen, oxygen, and nitrogen atoms in its formula, with an optional isotope-correction factor. Useful for routine stoichiometry on organic and biological molecules where C, H, O, and N dominate the elemental composition.

Last updated: May 2026

Compare with similar

About this calculator

Molecular weight (also called molar mass) is the mass of one mole of a substance, in grams per mole (g/mol). For a molecule with known elemental composition, it is computed as the sum of atomic weights weighted by atom counts: MW = Σ(n_i × M_i), where n_i is the count of atoms of element i and M_i is its standard atomic weight (from the IUPAC table, accounting for natural isotopic abundance). This calculator handles the four elements most common in organic and biochemical molecules: MW = (C·12.011 + H·1.008 + O·15.999 + N·14.007) × isotope_factor. The atomic weights are the IUPAC recommended values, averaged over natural isotopic distributions on Earth. The isotope correction multiplier scales the entire result — for example, in a fully ¹³C-enriched compound you would use ~1.001 to bump the calculated mass upward, and for D₂O-style deuterium substitution ~1.002. For a heavily isotope-labelled compound (uniformly ¹³C, ¹⁵N) the simple multiplier becomes less accurate; compute element-by-element with actual isotope masses. Edge cases: this calculator does not handle other elements (S, P, halogens, metals) — for those compounds, sum atomic weights manually or use a dedicated formula parser. It also does not understand structural formulas, ionic charge, or hydration; you must enter explicit atom counts from the molecular formula. The result is the molar mass of the neutral molecule; for ions you would add or subtract the electron mass, which is negligible (5.5 × 10⁻⁴ g/mol) for chemistry purposes.

How to use

Example 1 — Glucose (C₆H₁₂O₆). Enter carbonAtoms = 6, hydrogenAtoms = 12, oxygenAtoms = 6, nitrogenAtoms = 0, isotope = 1.0. MW = 6 × 12.011 + 12 × 1.008 + 6 × 15.999 + 0 × 14.007 = 72.066 + 12.096 + 95.994 + 0 = 180.156 g/mol. ✓ The tabulated value for glucose is 180.16 g/mol — match. One mole of glucose weighs 180.16 g, and a 1 M glucose solution needs 180.16 g per litre. Example 2 — Caffeine (C₈H₁₀N₄O₂). Enter carbonAtoms = 8, hydrogenAtoms = 10, oxygenAtoms = 2, nitrogenAtoms = 4, isotope = 1.0. MW = 8 × 12.011 + 10 × 1.008 + 2 × 15.999 + 4 × 14.007 = 96.088 + 10.08 + 31.998 + 56.028 = 194.194 g/mol. ✓ The reference value for caffeine is 194.19 g/mol — match. A 200 mg cup of strong coffee contains 200/194.19 ≈ 1.03 mmol of caffeine, useful when comparing pharmacological doses across reports that use mass vs molar units.

Frequently asked questions

What is the difference between molecular weight, molar mass, and atomic mass?

Atomic mass is the mass of a single atom of a specific element/isotope, measured in atomic mass units (amu or Da) — for example, ¹²C has an atomic mass of exactly 12 amu by definition. Molecular mass is the sum of the atomic masses of all atoms in a single molecule, also in amu. Molar mass is the mass of one mole (6.022 × 10²³ molecules) of a substance, in grams per mole (g/mol). Numerically, molecular mass in amu and molar mass in g/mol have the same value — water has molecular mass 18.02 amu and molar mass 18.02 g/mol — but they refer to single molecules versus moles, respectively. ‘Molecular weight’ is a sloppy older term that the chemistry community still uses; it usually means molar mass in g/mol. Modern IUPAC nomenclature prefers ‘relative molecular mass’ (M_r, dimensionless) and ‘molar mass’ (M, with units of g/mol).

Why are atomic weights not whole numbers?

Atomic weights are weighted averages over the natural isotopic distribution of an element. Most elements exist as a mix of isotopes — carbon is about 98.93% ¹²C (mass 12.000) and 1.07% ¹³C (mass 13.003), giving a weighted average of (0.9893 × 12.000 + 0.0107 × 13.003) ≈ 12.011. The same applies to hydrogen (¹H mass 1.008, ²H mass 2.014, natural mix ≈ 1.008), oxygen (¹⁶O 15.995, ¹⁷O 16.999, ¹⁸O 17.999, weighted average ~15.999), and nitrogen (¹⁴N ~99.6%, ¹⁵N ~0.4%, weighted average ~14.007). The values in this calculator are IUPAC’s standard atomic weights based on terrestrial natural abundance. For samples from non-terrestrial sources (meteorites, lab-synthesised isotopes), the actual isotope distribution can differ and you would recompute with the actual mass and abundance of each isotope.

Why does the formula limit to just C, H, O, and N?

CHON covers the vast majority of organic chemistry and biochemistry — proteins, carbohydrates, lipids, nucleic acids, and most natural products are built from carbon, hydrogen, oxygen, and nitrogen. By restricting to these four elements, the calculator can use a simple fixed formula with hard-coded atomic weights. Real organic molecules sometimes include sulfur (cysteine, methionine), phosphorus (DNA, ATP, phospholipids), halogens (Cl in some drugs, F in fluorinated polymers), and metals (haem iron, magnesium in chlorophyll). For those, sum the atomic weights manually: MW = (atoms of element 1 × atomic weight) + (atoms of element 2 × atomic weight) + … You can use this calculator for the CHON part and add other elements separately. A general molecular-weight tool that accepts formulas like ‘C₆H₈Cl₂’ would parse the formula and look up each element’s weight — a more complex parsing problem this calculator deliberately sidesteps.

What are the most common mistakes people make computing molecular weight?

The first is miscounting atoms in the molecular formula — overlooking hydrogens on heteroatoms (the H in alcohols, amines, carboxylic acids) is especially common since structural formulas often draw them implicitly. The second is using atomic mass (single isotope) when you should use atomic weight (natural mix); the standard reference values published by IUPAC are the natural-mix weights. The third is forgetting hydration in salts — copper(II) sulfate pentahydrate (CuSO₄·5H₂O) has a much higher MW than anhydrous CuSO₄. The fourth is summing without enough decimal places: 6 × 12 + 12 × 1 + 6 × 16 = 180 exactly, but the real MW is 180.156, and rounding too early can introduce 0.1–1% errors that propagate through stoichiometry. The fifth is treating molecular weight and formula weight differently — for ionic compounds like NaCl the formula weight IS the molar mass; the distinction only matters in pedantic contexts.

When should I not use this calculator?

Skip it for compounds containing elements other than C, H, O, N — sulphur (proteins), phosphorus (DNA, nucleotides), halogens (many pharmaceuticals), metals (organometallics, haem), or anything else. Compute those manually by summing atomic weights from a periodic table. Avoid it for high-precision mass spectrometry work where you need exact monoisotopic masses (mass with all atoms in their most abundant isotope) rather than weighted-average atomic weights — for instance, the exact monoisotopic mass of glucose is 180.0634 (using ¹²C, ¹H, ¹⁶O) versus the average 180.156 returned here. Skip it for ions and charged species in mass-spec analysis without applying electron mass corrections. It is also wrong for polymers and high-molecular-weight biomolecules where you need to add up many monomer units plus initiator/terminator groups — those typically use the polymer’s number-average or weight-average molecular weight (Mn, Mw) determined by chromatography or NMR. Finally, do not use it as a substitute for parsing a real molecular formula — the calculator doesn’t know that ‘C₆H₁₂O₆’ is glucose; you must enter the element counts yourself.

Sources & references