Skip to main content

Molecular Weight Calculator

Molar mass of a compound from its chemical formula, summed from the CIAAW 2024 standard atomic weights of all 118 elements. The parser expands nested parentheses and brackets and hydrate dots with whole or decimal coefficients, such as CaSO4·0.5H2O, and lists each element's share of the total. Elements with no standard atomic weight, such as technetium, use the mass number of their longest-lived isotope.

Runs entirely in your browser

This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.

Chemistry
Education
Loading the tool
Reference

Documentation

A molecular weight calculator adds up the atomic weights of every atom in a chemical formula to give the molar mass, the mass in grams of one mole of the substance (g/mol). For water, H2O, that is 2 x 1.008 + 15.999 = 18.015 g/mol. Strictly, molecular weight applies to molecules and formula weight to ionic compounds such as sodium chloride, but the arithmetic is the same and both are reported in g/mol.

Formulas use standard element symbols, a capital letter followed by at most one lowercase letter, so Co is cobalt while CO is carbon monoxide. A number after a symbol counts that atom, and a number after a closing parenthesis multiplies everything inside it, so Ca(OH)2 holds one calcium, two oxygen, and two hydrogen atoms, and Mg3(PO4)2 holds eight oxygen atoms. Groups can nest, and square or curly brackets work like parentheses, as in K4[Fe(CN)6]. Water of crystallization follows a middle dot, a bullet, an asterisk, or a period: CuSO4·5H2O, CuSO4*5H2O, and CuSO4.5H2O all mean copper(II) sulfate pentahydrate, and the coefficient multiplies every atom of the hydrate part. A fractional coefficient, such as the half water in plaster, CaSO4·0.5H2O, needs a dot or an asterisk, because after a period its decimal point would be ambiguous. Spaces are ignored, and an unknown symbol or an unmatched parenthesis stops the calculation with a message rather than returning a wrong figure. Ionic charges are not part of the notation; an electron weighs about 0.00055 g/mol, which is below the precision of most atomic weights.

Atomic weights are the abridged standard values published in 2024 by the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), based on its Atomic Weights 2021 report with the 2024 revisions for gadolinium, lutetium, and zirconium: hydrogen 1.008, carbon 12.011, nitrogen 14.007, oxygen 15.999, sodium 22.990, and chlorine 35.45. Each value averages the natural mix of isotopes, which varies slightly from one source of the element to another, so lithium is 6.94 and sulfur 32.06, each uncertain in its last digit. Technetium, promethium, polonium through actinium, and every element after uranium have no standard atomic weight; for them the IUPAC periodic table gives the mass number of the longest-lived isotope in square brackets, such as [97] for technetium and [244] for plutonium, and that whole number is used here.

The total is reported in g/mol, rounded for display to the decimal places chosen in Settings (2 to 6, default 4), with trailing zeros dropped, so water reads 18.015 rather than 18.0150. Extra decimal places do not add accuracy beyond the atomic weights themselves: chlorine is known to 35.45, so sodium chloride is good to about 58.44. Settings also holds an element breakdown that lists each atomic weight, atom count, and subtotal. Dividing a subtotal by the total gives that element's mass percent, as for oxygen in water, 15.999 / 18.015 = 88.8%.

Copper(II) sulfate pentahydrate, CuSO4·5H2O, contains 1 Cu, 1 S, 9 O, and 10 H atoms: 63.546 + 32.06 + 9 x 15.999 + 10 x 1.008 = 63.546 + 32.06 + 143.991 + 10.08 = 249.677 g/mol. Without its water of crystallization CuSO4 is 159.602 g/mol, so the five waters, 5 x 18.015 = 90.075 g/mol, make up 90.075 / 249.677 = 36.1% of the hydrate's mass.

Molecular weight calculations appear across laboratory work, academic coursework, industrial formulation, and research. Knowing the molar mass of a compound is fundamental to stoichiometry, solution preparation, and analytical method development.

  • Academic Chemistry: Homework and exam answers can be checked for formulas such as H2SO4 (sulfuric acid, 98.072 g/mol) or C2H5OH (ethanol, 46.069 g/mol). The elemental breakdown reinforces how individual atomic masses sum to the molecular total.
  • Laboratory Solution Preparation: The molar mass of a solute sets how much to weigh for a molar or molal solution. Potassium permanganate, KMnO4, is 158.032 g/mol, so 0.1 mol of it weighs 15.80 g.
  • Pharmaceutical Formulation: Active ingredient masses link mass-based and mole-based dosage calculations. Aspirin, C9H8O4, is 180.159 g/mol, a figure to confirm against the reference database for the drug before it enters a formulation record.
  • Polymer Science: Repeat-unit molecular weights scale up to chain masses. Ethylene, C2H4, is 28.054 g/mol, and multiplying by the degree of polymerization estimates the mass of a polyethylene chain.
  • Environmental Analysis: Pollutants, greenhouse gases, and water treatment chemicals all need molar masses for unit conversions: CO2 is 44.009 g/mol and calcium hypochlorite, Ca(ClO)2, is 142.976 g/mol.
  • Stoichiometric Calculations: Converting between grams and moles for each reactant and product builds a complete mass balance for a reaction, one compound at a time.
  • Material Science: Crystalline compounds and minerals often carry water of crystallization that must be counted in mass measurements. Washing soda, Na2CO3·10H2O, is 286.138 g/mol, against 105.988 g/mol for the anhydrous salt.
  • Food Science: Food additives, preservatives, and nutrients appear in nutritional calculations and ingredient labeling by mass and by moles. Citric acid, C6H8O7, is 192.123 g/mol.
Inputs, outputs, and what the Molecular Weight Calculator computes

What the Molecular Weight Calculator asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.

Inputs

  • Enter chemical formula (text input)
  • Decimal places · default: 4
  • Show elemental breakdown · default: off

Controls

Calculate · Reset

Example

Copper(II) sulfate pentahydrate, CuSO4·5H2O, contains 1 Cu, 1 S, 9 O, and 10 H atoms: 63.546 + 32.06 + 9 x 15.999 + 10 x 1.008 = 63.546 + 32.06 + 143.991 + 10.08 = 249.677 g/mol.