All Tools

Molecular Weight Calculator: Molar Mass of Any Formula

Type a chemical formula such as Ca(OH)2 or CuSO4·5H2O and get its molar mass in g/mol, with the mass and percent of each element. Free and private in your browser.

Capital letters start an element. Use brackets and a · or . between hydrate parts.

Type a formula such as Ca(OH)2 or CuSO4·5H2O, or pick one below.


About the Molecular Weight Calculator

The Molecular Weight Calculator finds the molar mass of any chemical formula. Type a formula such as H2O, C6H12O6, Ca(OH)2 or CuSO4·5H2O and the result shows the molar mass in g/mol, plus a table listing every element with its count, its contribution to the mass and its mass percent. Five quick-pick buttons fill in water, glucose, NaCl, CO₂ and H₂SO₄.

Molar mass is the mass of one mole of a substance, which is 6.02214076 × 10²³ particles. It is the number that lets you move between grams and moles in a chemical calculation, so it appears in every stoichiometry problem.

How to use the molecular weight calculator

Steps

  1. Type a formula in the Chemical formula field, or press a quick pick.
  2. Read the molar mass in g/mol under the field.
  3. Check the table for each element's count, mass and mass percent.

Write the formula without spaces. Element symbols start with a capital letter and may have one lowercase letter, so Co is cobalt but CO is carbon and oxygen. Counts follow the element or the closing bracket.

Formula syntax

  • Counts: H2O, C6H12O6. The count is a whole number from 1 to 99 999.
  • Brackets: round ( ), square [ ] and curly { } brackets can be nested, as in Ca(OH)2 and K4[Fe(CN)6]. A number after a closing bracket multiplies everything inside it.
  • Hydrates: join the parts with ·, . or *, as in CuSO4·5H2O. The number before the water, the 5, multiplies the whole part that follows.
  • Subscript digits: you can paste ₂ and ₃ directly, so H₂SO₄ works.

If the formula cannot be read, the calculator shows what is wrong, the character number and the formula with a caret under the exact spot, for example a missing closing bracket or a symbol that is not an element. Fix it and the result returns at once.

How molar mass is calculated

M=∑ini Aiwi=ni AiM×100%M = \sum_i n_i\,A_i \qquad w_i = \frac{n_i\,A_i}{M}\times 100\%

Each element's atomic weight A is multiplied by its count n in the formula, and the products are added to give the molar mass M. The mass percent of each element is its share of that total. The calculator holds all 118 elements, with the atomic weights as published by IUPAC (the CIAAW "Standard atomic weights of the elements 2021"). For elements whose weight varies with the source, such as hydrogen, carbon, oxygen and sulfur, it uses IUPAC's conventional abridged value. Radioactive elements with no stable isotope have no standard weight, so the mass number of their longest-lived isotope is used and flagged with an asterisk.

Worked examples

Example 1: water

H₂O = 2 × 1.008 + 15.999 = 18.015 g/mol. Hydrogen is 11.19 % and oxygen 88.81 % of the mass.

Example 2: glucose

C₆H₁₂O₆ = 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol.

Example 3: brackets

Ca(OH)₂ = 40.078 + 2 × (15.999 + 1.008) = 74.092 g/mol.

Example 4: a hydrate

CuSO₄·5H₂O adds five waters to copper sulfate and has a molar mass of 249.677 g/mol. Use this value, not the dry salt's, when you weigh the blue crystals.

Why other sites may show slightly different values

Atomic weights are rounded at different places. With IUPAC's abridged sulfur value of 32.06, sulfuric acid, H₂SO₄, comes to 98.072 g/mol, while sites that use 32.065 show 98.079. Both are correct to the precision of their tables, so use the number that matches your textbook or lab sheet.

Privacy

Nothing is uploaded; every calculation runs in your browser and never leaves your device.

Related tools

Use the Ideal Gas Law Calculator to turn moles into a gas volume, the Density Calculator for mass and volume of a substance, and the Mass Converter for grams, kilograms and other mass units.

Frequently asked questions

How do I calculate molecular weight from a formula?

Multiply each element's atomic weight by how many atoms of it the formula has, then add the results. Water, H2O, is 2 × 1.008 + 15.999 = 18.015 g/mol. Type the formula and the calculator does this for you and lists every element.

What is the difference between molecular weight and molar mass?

Molecular weight is a relative figure, and molar mass is the mass of one mole in g/mol. For practical work they have the same number, so water is about 18.015 either way. This tool reports it in g/mol.

How do I enter brackets and hydrates?

Use round, square or curly brackets, nested as needed, such as Ca(OH)2 or K4[Fe(CN)6]. For hydrates join the parts with a middle dot, a full stop or an asterisk, for example CuSO4·5H2O, CuSO4.5H2O or CuSO4*5H2O.

Why does it say my formula cannot be read?

The calculator marks the character where reading failed and underlines it with a caret. Typical causes are a missing closing bracket, a lowercase letter where a capital belongs, a symbol that is not an element, or a space. Fix that spot and the result returns.

Does it tell the difference between Co and CO?

Yes. Symbols are case-sensitive: a capital followed by an optional lowercase letter. Co is the element cobalt, while CO is one carbon and one oxygen, carbon monoxide.

Which atomic weights does it use?

It uses the IUPAC standard atomic weights from the CIAAW 2021 table for all 118 elements, with the conventional abridged value for elements that have an interval. Radioactive elements use the mass number of their longest-lived isotope and are marked with an asterisk.

Why is my textbook value slightly different?

Books and sites round atomic weights differently. For example sulfur is 32.06 here, so H2SO4 is 98.072 g/mol, while a table using 32.065 gives 98.079. The difference is in rounding, not in the chemistry.

What is mass percent?

It is the share of the total molar mass that comes from one element. In water, hydrogen contributes 2.016 of 18.015 g/mol, which is 11.19 %, and oxygen is the remaining 88.81 %.

Does it send my formula anywhere?

No. The formula is parsed and calculated in your browser, and nothing is uploaded, stored or shared with a server.

Other related tools