Molar mass calculator

Type a chemical formula. Capitals matter.

Type any formula, or tap an example; the molar mass, each element’s share and the working update for whatever you enter. Add a mass to convert it to moles and molecules.

How the molar mass is calculated

The molar mass of a substance is the sum of the atomic weights of the atoms in its formula, in grams per mole.[1] The calculator reads the formula, counts every atom (multiplying through brackets and hydrate dots), multiplies each count by the element's standard atomic weight, and adds. For sodium hydroxide, NaOH: 22.990 + 15.999 + 1.0080 = 39.997 g/mol.

The atomic weights are the CIAAW Abridged Standard Atomic Weights 2024, the values IUPAC recommends for everyday use: the 2021 report, with the 2024 revisions for gadolinium, lutetium and zirconium.[2][3] For the fourteen elements whose full standard atomic weight is an interval because natural samples vary (hydrogen, lithium, boron, carbon, nitrogen, oxygen, magnesium, silicon, sulfur, chlorine, argon, bromine, thallium and lead), the abridged table gives one conventional value with an uncertainty that covers the interval, and the calculator uses that value.

The arithmetic is exact: every atomic weight is held as an exact decimal fraction, so nothing is lost to rounding along the way. The result is rounded once, to the decimal place of the least precise atomic weight in the formula, because a sum is known only as finely as its coarsest term. That is why sodium chloride is 58.44 g/mol (chlorine's weight, 35.45, has two decimal places) while carbon dioxide is 44.009.

What you can type

WriteExampleMeaning
Element symbols with capitalsNaCl, Co, COCo is cobalt; CO is carbon and oxygen
Counts after a symbolC6H12O61 to 999
Brackets ( ) or [ ]Ca(OH)2, K4[Fe(CN)6]multiply what is inside; nested up to 4 deep
Hydrate dot · or . or *CuSO4·5H2O, CuSO4.5H2Oadds 5 whole H2O (1 to 99)
Charge after a caretSO4^2-, NH4^+does not change the result (see below)
Subscripts and superscriptsH₂O, SO₄²⁻read as above
State symbolNaCl(aq)ignored

Anything else is refused with a reason, never guessed. Lowercase input such as naoh is refused with the valid readings offered as buttons (NaOH); co2 offers both CO2 and Co2, because both are formulas. A trailing sign without a caret, such as Fe3+, is refused because it could be iron(III) or Fe3+. A leading number (2H2O) is a coefficient from an equation, not part of a formula. D and T (deuterium and tritium) are single isotopes with their own masses and are refused, as are elements with no standard atomic weight, such as technetium and plutonium, since their mass depends on the isotope.[2]

Ions

By convention the molar mass of an ion is the sum of its atomic weights; the electrons it gained or lost are ignored. Each electron weighs 0.000 548 6 g/mol.[4] For nearly every ion that changes nothing at the precision of the table; for the hydrogen ion H+ it changes the last digit (1.0075 instead of 1.0080), and the calculator shows the corrected value beside the conventional one.

Grams, moles and molecules

Below the result, the converter turns a mass into an amount (n = m/M) or an amount into a mass, and gives the number of formula units, n × 6.022 140 76 × 1023.[5] Amounts from 10−9 g to 109 g (or 10−12 to 107 mol) are accepted. The answer is rounded to the significant figures of the less precise of your number and the molar mass; a whole number typed without a decimal point, such as 2 or 100, is read as three significant figures, as textbook problems usually intend (type 2.0 or 100. to say exactly how many), and the value before rounding is shown beside the rounded one.[1]

Worked examples

FormulaWorkingg/mol
CO212.011 + 2 × 15.99944.009
NaOH22.990 + 15.999 + 1.008039.997
NaCl22.990 + 35.4558.44
H2O2 × 1.0080 + 15.99918.015
NH314.007 + 3 × 1.008017.031
CaCl240.078 + 2 × 35.45110.98
CaCO340.078 + 12.011 + 3 × 15.999100.086
C6H12O66 × 12.011 + 12 × 1.0080 + 6 × 15.999180.156
CuSO4·5H2O63.546 + 32.06 + 9 × 15.999 + 10 × 1.0080249.68

Values in other references can differ in the last digit, because they use older or unabridged atomic weights. These agree with PubChem's to within the stated uncertainty of the atomic weights for all 35 compounds checked.[6]

Sources

  1. Flowers, P., Theopold, K., Langley, R., Robinson, W. R. (2019). Chemistry 2e. OpenStax, Rice University. book §1.5 Measurement uncertainty, accuracy, and precision; §3.1 Formula mass and the mole concept; §4.1 Writing and balancing chemical equations; §4.3 Reaction stoichiometry; §4.4 Reaction yields.
  2. Commission on Isotopic Abundances and Atomic Weights (CIAAW), IUPAC (2024). Abridged Standard Atomic Weights 2024. CIAAW. dataset Based on the Atomic Weights 2021 report, with the 2024 revisions for Gd, Lu and Zr. Retrieved 2026-11-10.
  3. Prohaska, T., Irrgeher, J., Benefield, J., et al. (2022). Standard atomic weights of the elements 2021 (IUPAC Technical Report). Pure and Applied Chemistry 94(5), 573–600. doi:10.1515/pac-2019-0603. paper
  4. Mohr, P. J., Newell, D. B., Taylor, B. N., Tiesinga, E. (NIST) (2024). CODATA 2022 recommended value: electron relative atomic mass. National Institute of Standards and Technology. dataset
  5. Bureau International des Poids et Mesures (2019). The International System of Units (SI), 9th edition. BIPM. standard Section 2.3.1, the mole; the molar mass of carbon 12 after the 2019 redefinition.
  6. National Center for Biotechnology Information (2026). PubChem compound records (computed molecular weights). National Library of Medicine. dataset Molecular weights of 35 compounds retrieved 2026-11-10 through the PUG REST interface for the cross-check described on the About page.