Type any chemical formula and this free molar mass calculator returns its molecular weight in g/mol, the percent composition of every element, and converts between grams, moles and number of particles. Brackets, complexes like K₄[Fe(CN)₆] and hydrates like CuSO₄·5H₂O all work.
How molar mass is calculated
Worked example: H₂SO₄
- Count atoms: 2 H, 1 S, 4 O.
- Multiply by atomic masses: 2(1.008) + 32.06 + 4(15.999) = 2.016 + 32.06 + 63.996.
- Add them: 98.07 g/mol.
- Oxygen makes up 63.996 ÷ 98.07 = 65.25% of the mass.
- So 10 g of sulfuric acid is 10 ÷ 98.07 = 0.102 mol.
Writing formulas the calculator understands
- Brackets multiply everything inside: Ca(OH)₂ has 2 O and 2 H. Square brackets work too: K₄[Fe(CN)₆].
- Hydrates: write CuSO4·5H2O, CuSO4.5H2O or CuSO4*5H2O.
- Ions: charges such as SO4^2- or NH4+ are ignored for mass, because an electron’s mass is negligible.
Atomic masses are IUPAC standard atomic weights (conventional values). For radioactive elements without a stable isotope, the mass number of the longest-lived isotope is used.
Frequently asked questions
What is molar mass?
Molar mass is the mass of one mole of a substance, in grams per mole (g/mol). Numerically it equals the molecular or formula weight in atomic mass units, so water is 18.015 g/mol and 18.015 u per molecule.
Is molar mass the same as molecular weight?
In practice yes. Molecular weight (relative molecular mass) has no units, while molar mass is in g/mol, but the numbers are the same, so this works as a molecular weight calculator too.
How do I convert grams to moles?
Divide the mass in grams by the molar mass. Enter your formula, type the mass and choose grams, and the calculator shows moles and number of particles.
How do I calculate percent composition?
For each element, multiply its atom count by its atomic mass, divide by the total molar mass and multiply by 100. The table under the result lists this for every element.
Why do I get “unknown element”?
Element symbols are case-sensitive: the first letter is a capital and any second letter is lowercase. Write Co for cobalt, Cl for chlorine and Mg for magnesium.
Related tools
Free educational tool by HawkInc. Results are calculated in your browser and rounded for display; check critical work by hand or with a second method.