Molar Mass Calculator
The Molar Mass Calculator works out the molar mass of any chemical formula and shows how it is made up.
100% in-browser · no data sent
Enter a formula such as C6H12O6, Fe2(SO4)3 or CuSO4·5H2O and you get the total mass in g/mol, how much each element contributes, its mass percentage, and a grams ⇄ moles converter that uses the mass you just calculated.
Embed This Tool
Add this tool to your website with customizable styling
How to Use
Type a chemical formula
Write element symbols with a capital letter and subscripts as ordinary digits, e.g. H2O or NaHCO3. Brackets and hydrate dots work too: Ca(OH)2, K3[Fe(CN)6], CuSO4·5H2O.
Read the molar mass
The molar mass in grams per mole appears immediately and updates on every keystroke.
Check the composition
The table lists each element, how many atoms of it the formula contains, its atomic mass, the mass it contributes, and its percentage of the total.
Convert grams and moles
Enter a mass in grams to see how many moles that is, or enter moles to get the mass. Either field drives the other.
Frequently Asked Questions
What is molar mass?
Molar mass is the mass of one mole of a substance, in grams per mole (g/mol). You get it by adding up the standard atomic weight of every atom in the formula, so water (H2O) is 2 × 1.008 + 15.999 = 18.015 g/mol. It is numerically the same as the molecular weight, which is why the two terms are often used interchangeably.
How do I write formulas with brackets or hydrates?
Type them the way they are printed. A bracketed group takes its subscript as a multiplier, so Ca(OH)2 has two oxygen and two hydrogen atoms, and Fe2(SO4)3 has twelve oxygens. Hydrates use a dot before the water part with its own multiplier — CuSO4·5H2O, which you can also type as CuSO4.5H2O or CuSO4*5H2O. Nested brackets such as K3[Fe(CN)6] are handled as well.
How do I convert between grams and moles?
Divide by the molar mass to go from grams to moles, and multiply by it to go the other way: moles = mass ÷ molar mass. The calculator does this for you — type a mass into the grams field and the moles appear, or type moles and the grams appear.
What is mass percent composition?
It is the share of a compound's total mass that comes from each element. For each element, multiply its atomic mass by how many atoms are present, then divide by the molar mass. In glucose (C6H12O6) carbon accounts for about 40% of the mass, oxygen about 53% and hydrogen only about 7%, even though there are twice as many hydrogen atoms as carbon atoms.