Molecular Weight Calculator

Element Split
Formula & Quick Reference
Molar Mass = Σ (Atomic Weight × Atom Count) in g/mol
  • Parentheses ok: Supports formulas like Ca(OH)2 and C6H12O6
  • Moles: Divides sample mass (grams) by molar mass
  • Element split: Donut chart shows each element’s mass share

Interactive Graph

What Molecular Weight Means in Chemistry

Every atom has a tiny, specific weight measured in atomic mass units—or, when scaled up to lab-sized amounts, in grams per mole (g/mol). Molecular weight (often called molar mass) is simply the total weight of all the atoms inside a single molecule added together.

Water (H2O), for example, has two hydrogen atoms and one oxygen atom. Because oxygen is about sixteen times heavier than hydrogen, most of water’s weight comes from oxygen even though there are twice as many hydrogen atoms. Knowing the exact molar mass lets students and chemists convert back and forth between grams on a scale and moles in a chemical equation.

How the Formula Parser Works

Type any chemical formula—such as H2O, C6H12O6, NaCl, or Ca(OH)2—into the Chemical Formula box, and enter a sample weight in grams if you have one. Capitalization matters in chemistry: Co is cobalt, while CO is carbon monoxide (one carbon and one oxygen).

The calculator reads element symbols, subscripts, and parentheses automatically. It displays the total molar mass in g/mol, the number of moles in your sample mass, the total atom count, and which element makes up the biggest share of the weight. The donut chart on the right splits the molecule’s mass by element so you can see each atom’s contribution.

Step-by-Step Molar Mass Math

To find molar mass by hand, look up each element’s atomic weight on the periodic table, multiply it by how many times that atom appears in the formula, and add all the pieces together.

Take glucose (C6H12O6), a simple sugar: Carbon (C) has an atomic weight of 12.011 g/mol. With 6 atoms, 6 × 12.011 = 72.066 g/mol. Hydrogen (H) weighs 1.008 g/mol. With 12 atoms, 12 × 1.008 = 12.096 g/mol. Oxygen (O) weighs 15.999 g/mol. With 6 atoms, 6 × 15.999 = 95.994 g/mol.

Add those three totals together: 72.066 + 12.096 + 95.994 = 180.156 g/mol. That means one mole of pure glucose weighs 180.156 grams. If you weigh out 100 grams of glucose on a lab balance, divide 100 / 180.156 to find you have 0.5551 moles.

Handling Parentheses Like Ca(OH)2

When a formula has parentheses with a number outside, like calcium hydroxide Ca(OH)2, that outer number multiplies everything inside the parentheses. Here, you have 1 calcium (40.078), 2 oxygens (2 × 15.999 = 31.998), and 2 hydrogens (2 × 1.008 = 2.016), giving a total molar mass of 74.092 g/mol.

Why Moles and Mass Matter in the Lab

Chemical reactions happen molecule by molecule, not gram by gram. A balanced reaction might tell you that 2 moles of hydrogen react with 1 mole of oxygen—not 2 grams with 1 gram. Because you cannot count individual molecules with tweezers, chemists weigh out grams on a balance and divide by the molar mass (Moles = Grams / Molar Mass) to get the exact number of moles they need.

Helpful Habits When Writing Formulas

Always double-check two-letter element symbols so the first letter is uppercase and the second is lowercase (Na, Cl, Fe, Ca, Mg). If you accidentally type NA, the parser reads nitrogen (N) instead of sodium (Na). Also make sure closing parentheses match opening ones when typing polyatomic ions like Al2(SO4)3 or Mg(NO3)2. Checking the element breakdown on the donut chart is a quick way to confirm every atom was counted properly.

Percent Composition by Mass

Looking at the donut chart next to your molar mass result also teaches you percent composition—how much of a molecule’s total weight comes from each element. In table salt (NaCl), sodium weighs 22.990 g/mol and chlorine weighs 35.450 g/mol, for a total of 58.440 g/mol. Even though there is one atom of each, chlorine makes up 60.7% of the salt’s weight while sodium makes up 39.3%.

Chemists use percent composition to check whether a synthesized sample is pure or to figure out an unknown compound’s empirical formula from lab test results. Students can also use the sample mass box to convert grams straight into moles before balancing limiting-reactant problems.

Common Formulas to Test

Try entering everyday compounds to see how different elements affect weight: baking soda (NaHCO3 at 84.007 g/mol), table sugar or sucrose (C12H22O11 at 342.297 g/mol), aspirin (C9H8O4 at 180.159 g/mol), and rust (Fe2O3 at 159.687 g/mol). Watching how heavy atoms like iron (Fe) or calcium (Ca) shift the element split makes atomic weights feel much more concrete than memorizing numbers on a chart.

Hydrates and Multi-Part Formulas

In high school chemistry labs, you will sometimes see hydrate formulas written with a dot, such as copper(II) sulfate pentahydrate (CuSO4·5H2O). Because a dot simply means five water molecules are attached to each CuSO4 unit, you can calculate the molar mass of CuSO4 (159.609 g/mol), calculate H2O (18.015 g/mol), and add 5 × 18.015 = 90.075 g/mol to get 249.684 g/mol. Breaking complex compounds into smaller parts makes any chemistry worksheet much easier to manage.