Molecular Weight Calculator (Molar Mass)
Type a chemical formula such as CuSO4·5H2O to get its molar mass and element composition.

How to use the Molecular weight calculator
- Click the formula box and type a chemical formula, for example NaCl, Ca(OH)2 or CuSO4·5H2O. Use the correct capitals: Co is cobalt, CO is carbon monoxide.
- Check the result line. It shows the molar mass in g/mol and the formula as the tool read it.
- Read the atoms per formula unit and the composition table. Each row gives the atoms of one element, its mass contribution and its mass percent.
- If you need a mass, enter an amount in the optional amount field and choose mol, mmol, µmol or nmol. The tool shows the mass in grams.
- Open “How it was calculated” under the result to see the formula and each step with your own numbers.
- Nested brackets work as written: in (NH4)2SO4 the 2 multiplies everything inside the brackets, and in K4[Fe(CN)6] the 6 multiplies each CN group.
- If the tool shows an error, read the message. It names the unknown symbol or the unbalanced bracket. Fix that part and the result updates.
Use Copy result to copy the result lines with a link to the calculation. Use Copy link to copy the page address, which stores every input so the same calculation reopens later. Print / save as PDF prints the inputs, results, calculation steps and the date.
How do you calculate molecular weight (molar mass) from a formula?
Count the atoms of each element in the formula, multiply each count by that element’s atomic weight, and add the results. The total is the molar mass in g/mol. For example, glucose, C6H12O6, has 6 carbon, 12 hydrogen and 6 oxygen atoms, so its molar mass is 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.16 g/mol.
What is the difference between molar mass and molecular weight?
They give the same number for a compound, so the tool treats them as one value. Molar mass has the unit g/mol, which describes the mass of one mole. Molecular mass is usually written in daltons (u), which describes the mass of one molecule or formula unit. The number matches because one mole contains Avogadro’s number of particles, so the mass of one mole in grams equals the mass of one particle in daltons.
How do you include water of crystallization (hydrates)?
Write the water after a dot, a middle dot (·) or an asterisk (). The tool accepts all three, so CuSO4·5H2O and CuSO45H2O give the same result. Each H2O adds its own atoms to the count, so the 5 multiplies both the hydrogen and the oxygen. For CuSO4·5H2O, you have 1 Cu, 1 S, 9 O and 10 H, which gives 249.68 g/mol.
How do you calculate the mass percent of each element?
Divide the total mass of that element by the molar mass and multiply by 100. The total mass of an element is its atom count multiplied by its atomic weight. For copper in CuSO4·5H2O, 63.546 ÷ 249.68 × 100 = 25.45%. The composition table shows this value for every element in the formula.
Which atomic weights are used?
The tool uses IUPAC standard atomic weights, in their abridged or conventional form. Examples include H 1.008, C 12.011, O 15.999, Na 22.990 and Cu 63.546. Some elements have no stable isotope. For those, the tool uses the mass number of the longest-lived isotope and shows a warning.
How many grams are in a mole of a compound?
One mole of a compound has a mass in grams equal to its molar mass. One mole of NaCl is 58.44 g, and one mole of glucose is 180.16 g. To find the mass for another amount, multiply moles by the molar mass: 0.1 mol of CuSO4·5H2O is 0.1 × 249.68 = 24.97 g.
Sources
Formulas and data used by this calculator (checked October 2026):
- IUPAC CIAAW, abridged standard atomic weights (2024)
- PubChem periodic table (mass numbers of elements without a standard atomic weight)
Worked examples
| Input | Result |
|---|---|
| NaCl | NaCl = 58.44 g/mol |
| CuSO4·5H2O | CuSO4·5H2O = 249.68 g/mol (0.1 mol = 24.97 g) |
| C6H12O6 | C6H12O6 = 180.16 g/mol (50 mmol = 9.008 g) |
| (NH4)2SO4 | (NH4)2SO4 = 132.13 g/mol |
| Ca(OH)2 | Ca(OH)2 = 74.092 g/mol |
Calculated by the tool above with these values.
Frequently asked questions
Why does the tool show an error for my formula?
The error names the problem, such as an unknown element symbol or an unbalanced bracket. Check the capitals first, since Co and CO are different. Then check that every opening bracket ( ), [ ] or { } has a matching closing bracket.
What does the warning about an element mean?
The warning appears when an element has no stable isotope. The tool then uses the mass number of its longest-lived isotope, so the molar mass is an approximation for that element.
Can I calculate the molecular weight of a protein here?
No. For proteins, use the protein molecular weight calculator, which takes a sequence as input.
Can I use the results in commercial work?
Yes. Results may be used freely in reports, SOPs, quotes and product documentation, and no attribution is required.
Does the tool store my formula?
Nothing is uploaded, because the calculation runs in your browser. Copy link adds your inputs to the page address, so anyone with that link will see the same formula when it opens.
Can I use the tool to find grams from moles?
Yes. Enter the amount in the optional field with mol, mmol, µmol or nmol selected. The tool multiplies the amount by the molar mass and shows the mass in grams.
Related tools
- Molarity calculator: use it when you know the molar mass and need the concentration of a solution.
- Mass to moles calculator: use it to convert a measured mass into moles of a compound.
- Concentration converter: use it to change a concentration from one unit to another.
- Protein molecular weight calculator: use it for protein molecular weight from a sequence.
- Dilution calculator: use it to work out how much stock solution to dilute to a target concentration.
- Percent recovery calculator: use it to compare a measured amount with the expected amount.
- All laboratory calculators: use it to browse every calculator on the site.