Molecular Weight Calculator

Type a chemical formula to get its molar mass in g/mol, a breakdown by element with mass percent, and quick grams-to-moles conversions.

Case-sensitive: Co is cobalt, CO is carbon monoxide.
g
Converted to moles
mol
Converted to grams

Result

Molar mass180.156 g/molHill formula: C6H12O6
10 g is0.05551 mol
0.5 mol is90.078 g
ElementAtomsAtomic wt.MassMass %
H Hydrogen121.00812.0966.71%
C Carbon612.01172.06640%
O Oxygen615.99995.99453.28%

How molar mass is calculated

The molar mass of a compound is the sum of the atomic weights of all the atoms in its formula. For glucose, C6H12O6: 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol. The calculator reads the formula, counts every atom, looks up each atomic weight and adds them, then shows what share of the mass each element contributes.

Formula syntax the calculator understands

  • Simple formulas: NaCl, H2SO4, C8H10N4O2.
  • Groups in parentheses or brackets: Ca(OH)2, Al2(SO4)3, K4[Fe(CN)6].
  • Hydrates: CuSO4·5H2O, MgSO4*7H2O or Na2CO3.10H2O.
  • Subscript digits pasted from a document, such as H₂O, are converted automatically.

Worked example: copper(II) sulfate pentahydrate

ElementAtomsAtomic weightSubtotal
Cu163.54663.546
S132.0632.06
O915.999143.991
H101.00810.08
Total249.68 g/mol

Mass percent composition

Mass percent tells you how much of a sample's mass comes from each element: the element's subtotal divided by the molar mass, times 100. Water is 11.19% hydrogen and 88.81% oxygen by mass. Comparing a measured composition with these values is a quick way to check an unknown compound in the lab.

From grams to moles and back

moles = grams ÷ molar mass and grams = moles × molar mass. To make 250 mL of a 0.5 M sodium chloride solution you need 0.125 mol, which is 0.125 × 58.44 = 7.31 g of NaCl. Setting up these conversions is a direct proportion, the same idea behind the proportion calculator.

Accuracy note

Standard atomic weights reflect natural isotope mixtures and are published by IUPAC. Some elements, such as hydrogen, carbon and sulfur, vary slightly with their source, so results are shown to two decimal places, which is more than enough for classroom and most lab work. For high-precision mass spectrometry use exact isotopic masses instead.

Frequently asked questions

What is the difference between molecular weight and molar mass?

Molecular weight (relative molecular mass) is dimensionless, while molar mass has units of grams per mole. For practical chemistry they have the same number: water is 18.015 and 18.015 g/mol.

How do I enter a hydrate?

Use a dot, an asterisk or a middle dot between the parts, with the coefficient in front of the water: CuSO4·5H2O, CuSO4*5H2O or CuSO4.5H2O all work.

Are element symbols case-sensitive?

Yes. Co is cobalt but CO is carbon monoxide. Start every symbol with a capital letter and write the second letter in lowercase.

Which atomic weights does the calculator use?

IUPAC standard atomic weights, rounded to about five significant figures. Radioactive elements without stable isotopes use the mass number of their longest-lived isotope.

How do I convert grams to moles?

Divide the mass in grams by the molar mass. 36 g of water is 36 ÷ 18.015 = 2.0 moles.

Sources and official references

Last reviewed October 10, 2026. Results are estimates for planning; see our disclaimer.

Molecular Weight guides

A round glass dish on white paper in a laboratoryMolar Mass vs. Molecular Weight vs. Formula Mass: What's the Difference?Clear definitions of molar mass, molecular weight, formula mass and atomic mass units, why their numbers match, and how to calculate each from a chemical formula.3 min readA scientist using a pipette with test tubes in a labGrams to Moles and Moles to Grams: Conversions with Worked ExamplesConvert between grams, moles and number of particles using molar mass and Avogadro's number, with step-by-step examples and a stoichiometry walkthrough.2 min readTest tubes filled with different colored liquidsPercent Composition by Mass: How to Calculate It and Why It MattersCalculate the mass percent of each element in a compound from its formula, check the result, and use percent composition in labs, nutrition labels and fertilizers.2 min readA person in green gloves using a pipette to fill a small vialMolarity and Preparing Solutions: From Molar Mass to Grams to WeighCalculate how many grams to weigh for a solution of a given molarity, dilute stock solutions with C1V1 = C2V2, and avoid common preparation mistakes.2 min readA gloved hand holding a test tube filled with liquidMolar Mass of Hydrates: Formulas, Calculations and the Classic Heating LabHow to read hydrate formulas like CuSO4·5H2O, calculate their molar mass and percent water, and find the formula of an unknown hydrate from lab data.2 min readA laboratory workbench with a microscope and analytical equipmentEmpirical and Molecular Formulas: From Percent Composition to the Real FormulaFind an empirical formula from percent composition or masses, then use molar mass to get the molecular formula. Worked examples with every step.2 min read