Molar mass calculator
Type a chemical formula, get its molar mass and composition.
How do I calculate molar mass?
Add up the atomic weights of every atom in the formula. Water, H₂O, is 2 × 1.008 + 15.999 = 18.015 g/mol; sodium chloride, NaCl, is 22.990 + 35.45 = 58.44 g/mol.
How do I handle parentheses and hydrates?
Multiply everything inside the brackets by the number after them: Ca(OH)₂ has 2 oxygens and 2 hydrogens, 74.092 g/mol. For a hydrate like CuSO₄·5H₂O, add 5 waters: 249.677 g/mol. Type the dot as ·, * or a period.
Where do the atomic weights come from?
From the IUPAC Commission on Isotopic Abundances and Atomic Weights, abridged standard atomic weights (2024), to five significant figures where nature allows. Some, like chlorine (35.45) and lead (207.2), are given to fewer digits because they vary in nature.
What is percent composition?
Each element's share of the total mass: oxygen is 15.999 ÷ 18.015 = 88.8% of water by mass.
What about radioactive elements like technetium?
They have no standard atomic weight. The calculator uses the mass number of the most stable isotope, as periodic tables do in brackets — Tc [97] — and says so.
What is the difference between molar mass and molecular weight?
They have the same number. Molar mass is in grams per mole (g/mol) and describes a mole of the substance, while molecular or formula mass is in atomic mass units and describes one formula unit. Water is 18.015 g/mol, and one molecule of it is 18.015 u. For ionic compounds with no separate molecules, such as NaCl, the term formula mass is used.
How do I get from grams to moles?
Divide the mass by the molar mass. 100 g of glucose, C₆H₁₂O₆ (180.156 g/mol), is 100 ÷ 180.156 = 0.555 mol, which is 3.34 × 10²³ molecules, using the exact Avogadro constant 6.02214076 × 10²³ per mole. The grams-to-moles calculator does this directly.
Why does CO give a different answer from Co?
Capital letters begin each element symbol, so CO is carbon and oxygen (28.010 g/mol) while Co is cobalt (58.933 g/mol). The calculator needs the capitalization exactly as in the chemical formula.
How the calculation works
The formula is read left to right. A number after an element symbol multiplies that element; a number after a closing bracket multiplies everything inside it; and a number in front of a group, as in 5H₂O, multiplies the whole group. Each element's count is multiplied by its atomic weight, and the products are summed. Percent composition is each element's mass divided by the total.
Worked example: aluminum sulfate
Al₂(SO₄)₃ contains 2 aluminum, 3 sulfur, 12 oxygen atoms: the 3 outside the bracket multiplies the S and the O inside, giving 3 sulfur and 12 oxygen. The masses are 2 × 26.982 = 53.964; 3 × 32.06 = 96.180; 12 × 15.999 = 191.988. The total is 342.132 g/mol. By mass the compound is 15.8% aluminum, 28.1% sulfur, 56.1% oxygen.
Calcium phosphate, Ca₃(PO₄)₂, works the same way: 3 calcium, 2 phosphorus and 8 oxygen atoms, for 310.174 g/mol.
Common mistakes
Forgetting to multiply the atoms inside a bracket is the usual error: in Ca(OH)₂ there are two oxygens and two hydrogens, not one of each. Another is the hydrate dot, which means addition, not multiplication: CuSO₄·5H₂O is the copper sulfate plus five waters, not a product. Mixing up capitalization changes the compound (CO versus Co). Finally, atomic weights for elements such as hydrogen, carbon and oxygen are intervals in the IUPAC tables because their isotopic makeup varies in nature, so molar masses are good to the digits shown but not to every decimal place; for homework use the weights your textbook uses.
Sources: IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), standard atomic weights; the Avogadro constant is exact in the 2019 SI. Related: grams to moles calculator, molarity calculator, empirical formula calculator, stoichiometry calculator.