ToolNimba

โš—๏ธ Molecular Weight Calculator (Molar Mass from a Formula)

By ToolNimba Editorial Team ยท Updated 2026-06-20

Molar mass
-

Type a formula to compute its molar mass and per-element breakdown.

This molecular weight calculator turns a chemical formula into a molar mass in grams per mole. Type something like C6H12O6, NaCl, or Ca(OH)2 and it parses the symbols, handles parentheses and hydrate dots, and adds up the standard atomic weights for you. You also get a per-element breakdown with the mass percent each element contributes, computed entirely in your browser.

What is the Molecular Weight Calculator?

The molecular weight (also called molar mass or formula weight) of a compound is the mass of one mole of that substance, measured in grams per mole (g/mol). It is found by adding up the standard atomic weight of every atom in the chemical formula. For water, H2O, that means two hydrogen atoms at about 1.008 each plus one oxygen at about 15.999, giving roughly 18.015 g/mol. The same idea scales to any formula, no matter how many elements or how many of each atom it contains.

The only real work is reading the formula correctly. A subscript multiplies the element directly before it, so O2 means two oxygen atoms. A number after a bracket multiplies everything inside the group, so Ca(OH)2 means one calcium, two oxygen, and two hydrogen. A dot in a formula, as in CuSO4.5H2O, separates a hydrate: the number in front of the dotted part (here 5) multiplies that whole water unit. This calculator follows all of those rules with a recursive parser, so nested groups like K4[Fe(CN)6] are handled correctly.

Mass percent tells you what fraction of the total mass comes from each element. It is the subtotal for that element (its atomic weight times how many atoms there are) divided by the molar mass of the whole compound, expressed as a percentage. Mass percents always add up to 100 percent, which is a handy check. They matter in the lab for working out how much of a target element you actually get from a given mass of reagent.

Molar mass is the bridge between the mass you can weigh on a balance and the number of moles you reason about in a balanced equation. Divide a sample mass in grams by the molar mass to get moles, or multiply moles by molar mass to predict the mass of product. Getting the molecular weight right is therefore the first step in almost every stoichiometry, dilution, or yield calculation.

When to use it

  • Converting between grams and moles for stoichiometry, limiting-reagent, and theoretical-yield problems.
  • Preparing a solution of a known molarity by weighing out the correct mass of a solid or hydrate.
  • Checking chemistry homework where you must find the molar mass of a compound from its formula.
  • Working out the mass percent of an element, for example the nitrogen content of a fertiliser.

How to use the Molecular Weight Calculator

  1. Type a chemical formula into the box, using capital letters for the first letter of each symbol (Na, not NA).
  2. Add subscripts as plain numbers after the symbol or bracket, for example H2O or Ca(OH)2.
  3. For a hydrate, use a dot, as in CuSO4.5H2O, and the calculator multiplies the water part for you.
  4. Read the molar mass in g/mol and scan the table for each element's subtotal and mass percent.

Formula & method

Molar mass = sum over every element of (atomic weight x number of atoms). A subscript multiplies the symbol before it, and a number after a bracket multiplies the whole group. Mass percent of an element = (element subtotal ÷ molar mass) x 100. Worked symbolically: for AxBy, M = x·Aw + y·Bw.

Worked examples

Find the molar mass of glucose, C6H12O6.

  1. Carbon: 6 x 12.011 = 72.066
  2. Hydrogen: 12 x 1.008 = 12.096
  3. Oxygen: 6 x 15.999 = 95.994
  4. Add the subtotals: 72.066 + 12.096 + 95.994

Result: Molar mass of C6H12O6 is about 180.156 g/mol.

Find the molar mass of calcium hydroxide, Ca(OH)2.

  1. The 2 outside the bracket multiplies both O and H inside it.
  2. Calcium: 1 x 40.078 = 40.078
  3. Oxygen: 2 x 15.999 = 31.998
  4. Hydrogen: 2 x 1.008 = 2.016

Result: Molar mass of Ca(OH)2 is about 74.092 g/mol.

Standard atomic weights of common elements (g/mol)

ElementSymbolAtomic weight
HydrogenH1.008
CarbonC12.011
NitrogenN14.007
OxygenO15.999
SodiumNa22.990
SulfurS32.060
ChlorineCl35.450
CalciumCa40.078
IronFe55.845

Molar mass of some everyday compounds

CompoundFormulaMolar mass (g/mol)
WaterH2O18.015
Table saltNaCl58.440
Carbon dioxideCO244.009
GlucoseC6H12O6180.156
SucroseC12H22O11342.297
Calcium carbonateCaCO3100.087
Sulfuric acidH2SO498.079

Common mistakes to avoid

  • Writing symbols with the wrong capitalisation. Element symbols are case sensitive. CO is carbon monoxide, but Co is cobalt, and "co" is nothing at all. Always capitalise the first letter and lowercase the second, so write Cl, not CL or cl.
  • Ignoring a bracket multiplier. In Ca(OH)2 the 2 applies to everything inside the parentheses, giving two O and two H, not just two of the last atom. Multiply the whole group, then add it to the rest.
  • Confusing molecular weight with molecular formula. The molecular weight is a single number in g/mol. The molecular formula lists the atoms. You need the correct formula first, then you add up weights to get the molar mass.
  • Forgetting the water in a hydrate. CuSO4.5H2O weighs far more than anhydrous CuSO4 because the five water molecules add about 90 g/mol. If a problem names a hydrate, include those waters in the total.

Glossary

Molecular weight
The mass of one mole of a substance, equal to the sum of the atomic weights of all atoms in its formula. Measured in g/mol.
Molar mass
Another name for molecular weight, the mass in grams of one mole of a compound or element.
Atomic weight
The standard (average) mass of an atom of an element, in atomic mass units, numerically equal to its contribution in g/mol.
Mole
A counting unit equal to about 6.022 x 10^23 particles, the amount of substance whose mass in grams equals its molar mass.
Mass percent
The fraction of a compound's mass that comes from one element, written as a percentage. All elements together sum to 100 percent.
Hydrate
A compound that includes water molecules in its structure, shown with a dot, for example CuSO4.5H2O for copper sulfate pentahydrate.

Frequently asked questions

How do I calculate the molecular weight of a compound?

Multiply the atomic weight of each element by how many atoms of it appear, then add the results. For CO2 that is 12.011 + 2 x 15.999 = 44.009 g/mol. This tool does the parsing and adding for you.

Is molecular weight the same as molar mass?

For everyday purposes, yes. Molecular weight, molar mass, and formula weight all describe the mass of one mole of a substance in g/mol. The numbers are identical, so the terms are used interchangeably here.

How do I enter a formula with parentheses?

Type the group in parentheses with its multiplier right after, such as Ca(OH)2 or Al2(SO4)3. The number outside the bracket multiplies every atom inside it. Square brackets like K4[Fe(CN)6] also work.

How do I calculate the molar mass of a hydrate?

Use a dot to separate the water, as in CuSO4.5H2O. The number before the dotted part multiplies the whole water unit, so this calculator adds 5 x 18.015 g/mol of water to the anhydrous salt automatically.

What atomic weights does this calculator use?

It uses IUPAC standard (conventional) atomic weights, the same average values printed on most periodic tables, for example 12.011 for carbon and 1.008 for hydrogen. Results are rounded to three decimals for display.

Why does my answer differ slightly from a textbook?

Small differences come from rounding and from which atomic-weight values a source uses. Standard atomic weights are averages over natural isotopes, so a table that rounds H to 1.01 or O to 16.00 will give a marginally different total.