Molecular Weight Calculator

Type a chemical formula and get the molar mass in g/mol, plus the mass and percent composition of every element in the compound. Parentheses and hydrates included. No signup, no email.

No account required 100% private Free Forever

Your compound

Type a chemical formula — the molar mass and the element-by-element breakdown update as you type. Groups like Ca(OH)2 and hydrates like CuSO4·5H2O work too.

Try an example
Enter a formula to see the molar mass and the mass of each element.

Mass breakdown by element

Element Atoms Atomic weight Mass Mass %

Molar mass = = g/mol

This is a free molecular weight calculator: enter a chemical formula and the molar mass appears instantly in g/mol, along with how many grams each element contributes and its percent of the total. It handles parentheses like Ca(OH)2, hydrates like CuSO4·5H2O, and every element on the periodic table. The arithmetic runs in your browser — no AI model, no upload, nothing saved.

How to use the molecular weight calculator

Type the chemical formula

Enter the compound the way your textbook writes it — C6H12O6, Ca(OH)2, CuSO4·5H2O. Capitalisation matters: CO is carbon monoxide, Co is cobalt.

Read the molar mass

The total appears in g/mol as you type. There is no button to press and no page reload — the parser and the atomic weights both live in your browser.

Check the element breakdown

The table below the input shows how many atoms of each element the formula contains, the grams each contributes, and its percent of the total mass — the working you can copy into an answer.

Molecular weight, molar mass, formula weight

Three names your textbook uses for numbers that come out the same on this page. What differs is what the number describes.

Molecular weight

The mass of one molecule relative to 1/12 of a carbon-12 atom. It is a ratio, so strictly it has no units — but the number is identical to the molar mass, which is why the two get used interchangeably in homework.

Molar mass

The mass of one mole — 6.022 × 10²³ particles — of a substance, in grams per mole. This is the number you actually weigh out on a balance, and the one the calculator labels g/mol.

Formula weight

The same sum for ionic compounds like NaCl, which have no discrete molecules — a crystal is a lattice, not a molecule. The arithmetic over the formula unit is unchanged, so the calculator handles it identically.

Formulas the parser understands

Two things trip students up more than the arithmetic does — bracketed groups and water of crystallisation.

Parentheses and groups

A subscript after a bracket multiplies everything inside it, including nested groups. Ca(OH)2 is two oxygens and two hydrogens, not one of each — the single most common place a hand calculation goes wrong.

  • Ca(OH)2 — 74.092 g/mol
  • Al2(SO4)3 — 342.132 g/mol
  • (NH4)2CO3 — 96.086 g/mol
  • Mg(NO3)2 — 148.313 g/mol

Hydrates and the dot

The dot in a hydrate means "plus", and the number in front of the water multiplies the whole H2O unit. Type the dot as · or a plain * — both parse. Leave the water out and your molar mass will be far too low.

  • CuSO4·5H2O — 249.677 g/mol
  • CaSO4·2H2O — 172.164 g/mol
  • Na2CO3·10H2O — 286.138 g/mol
  • MgSO4·7H2O — 246.466 g/mol

How to calculate molecular weight from a formula

Molecular weight is the sum of the atomic weights of every atom in the formula. Multiply each element's atomic weight by its subscript, then add the products together:

Molecular weight = Σ (atomic weight of element × number of atoms)

Worked example, water. H₂O has two hydrogens and one oxygen. Hydrogen weighs 1.008 and oxygen weighs 15.999, so the sum is (2 × 1.008) + (1 × 15.999) = 2.016 + 15.999 = 18.015 g/mol.

Worked example, calcium carbonate. CaCO₃ is one calcium, one carbon, and three oxygens: (1 × 40.078) + (1 × 12.011) + (3 × 15.999) = 40.078 + 12.011 + 47.997 = 100.086 g/mol.

Parentheses multiply everything inside them. Ca(OH)₂ is one calcium plus two OH units — so two oxygens and two hydrogens, not one of each: 40.078 + (2 × 15.999) + (2 × 1.008) = 74.092 g/mol.

Percent composition by mass

Once you have the total, the share each element contributes is a second division:

Mass percent = (mass contributed by the element / total molecular weight) × 100

In water, hydrogen contributes 2.016 of 18.015 g/mol, which is 11.19% — oxygen carries the other 88.81%. The calculator prints this column next to every element so you can check a percent-composition question without a second pass.

More EduSolver chemistry tools

Molar mass is the number the rest of a chemistry problem usually hangs on. These free tools pick it up from there:

Worked examples

The four compounds below are the ones homework asks for most often, pre-computed with the same math the calculator runs. Type any other formula above to get the same table for your compound.

H2O — Water

Molar mass 18.015 g/mol

Element Atoms Mass Mass %
H Hydrogen 2 2.016 g/mol 11.19%
O Oxygen 1 15.999 g/mol 88.81%
Total 3 18.015 g/mol 100%

NaCl — Sodium chloride (table salt)

Molar mass 58.44 g/mol

Element Atoms Mass Mass %
Na Sodium 1 22.99 g/mol 39.34%
Cl Chlorine 1 35.45 g/mol 60.66%
Total 2 58.44 g/mol 100%

C6H12O6 — Glucose

Molar mass 180.156 g/mol

Element Atoms Mass Mass %
C Carbon 6 72.066 g/mol 40%
H Hydrogen 12 12.096 g/mol 6.71%
O Oxygen 6 95.994 g/mol 53.28%
Total 24 180.156 g/mol 100%

CaCO3 — Calcium carbonate

Molar mass 100.086 g/mol

Element Atoms Mass Mass %
Ca Calcium 1 40.078 g/mol 40.04%
C Carbon 1 12.011 g/mol 12%
O Oxygen 3 47.997 g/mol 47.96%
Total 5 100.086 g/mol 100%

Atomic weights of common elements

These are the standard atomic weights the calculator multiplies by each subscript. All 118 elements are supported — the table below is the short list that covers most school chemistry.

Symbol Element Atomic number Atomic weight (g/mol)
H Hydrogen 1 1.008
C Carbon 6 12.011
N Nitrogen 7 14.007
O Oxygen 8 15.999
Na Sodium 11 22.99
Mg Magnesium 12 24.305
Al Aluminium 13 26.982
Si Silicon 14 28.085
P Phosphorus 15 30.974
S Sulfur 16 32.06
Cl Chlorine 17 35.45
K Potassium 19 39.098
Ca Calcium 20 40.078
Fe Iron 26 55.845
Cu Copper 29 63.546
Zn Zinc 30 65.38
Ag Silver 47 107.87
I Iodine 53 126.9

Other chemistry tools

Frequently Asked Questions

What is the difference between molecular weight and molar mass?
Molecular weight is a ratio — the mass of one molecule compared with 1/12 the mass of a carbon-12 atom — so it is formally dimensionless. Molar mass is the mass of one mole (6.022 × 10²³ particles) of that substance, measured in grams per mole. The numbers are identical: water is 18.015 either way. That is why teachers and textbooks use the terms interchangeably, and why this calculator reports one number labelled g/mol. Use "formula weight" instead when the compound is ionic, like NaCl, because a salt crystal is a lattice rather than a set of discrete molecules.
How do you calculate molecular weight from a chemical formula?
Multiply each element's atomic weight by the number of its atoms in the formula, then add the results. For glucose, C₆H₁₂O₆: carbon is 6 × 12.011 = 72.066, hydrogen is 12 × 1.008 = 12.096, oxygen is 6 × 15.999 = 95.994, and the total is 180.156 g/mol. A subscript after a bracket multiplies everything inside the bracket, so Ca(OH)₂ contains two oxygens and two hydrogens. The calculator above does exactly this and shows each product on its own row.
What units is molecular weight measured in?
Molar mass is reported in grams per mole (g/mol). The mass of a single molecule is usually given in unified atomic mass units, written u or Da (daltons) — one water molecule is 18.015 u, and one mole of water is 18.015 g. The two scales are defined so the number never changes, only the label. Molecular weight itself, being a ratio of masses, has no units at all; if an exam asks for units on a molecular weight, g/mol is what it is looking for.
What are the most common mistakes when calculating molar mass?
Four come up over and over. First, ignoring a bracket subscript — in Ca(OH)₂ the 2 applies to both the O and the H. Second, dropping the water in a hydrate: CuSO₄·5H₂O is 249.677 g/mol, not the 159.602 g/mol of the anhydrous salt. Third, mixing up capitalisation, so Co (cobalt, 58.933) gets used where CO (carbon monoxide, 28.010) was meant. Fourth, using the equation's coefficient as if it were a subscript — the 2 in 2H₂O multiplies the number of molecules in a reaction, not the mass of one of them. The calculator flags a symbol it does not recognise instead of silently guessing.
Does the calculator handle parentheses and hydrates?
Yes. Nested brackets work — round or square — and the subscript after a closing bracket multiplies the whole group, so Al₂(SO₄)₃ resolves to 2 aluminium, 3 sulfur, and 12 oxygen atoms. Hydrates are written with a dot: type CuSO₄·5H₂O, CuSO4*5H2O, or CuSO4.5H2O and all three parse the same way, with the 5 multiplying the entire H₂O unit. Pasted subscripts like H₂O are converted automatically. Anything the parser cannot read produces a message explaining what is wrong rather than a wrong number.
Is this molecular weight calculator free?
Yes — free, with no account, no email, and no limit on how many compounds you look up. The formula parser and the full 118-element table of standard IUPAC atomic weights are loaded into your browser, so the arithmetic is done locally and instantly. No AI model is involved in the calculation, and nothing you type is uploaded, logged, or saved anywhere.

Stuck on the chemistry around the molar mass?

EduSolver's AI tutor balances the equation, works the stoichiometry, and explains each step — then turns it into flashcards for the test.