What is a molar mass calculator?
A molar mass calculator is a free online tool that reads a chemical formula and returns the mass of one mole of that substance, expressed in grams per mole (g/mol). You type a formula such as H2O, C6H12O6, or Ca(OH)2, and the calculator identifies each element, looks up its standard atomic weight, multiplies that weight by the number of atoms present, and adds everything together. The molar mass is the bridge between the number of particles in a sample and a quantity you can actually weigh on a balance, which makes it one of the most-used values in chemistry.
How does it work?
Every element on the periodic table has a standard atomic weight, a value averaged over the naturally occurring isotopes and measured relative to carbon-12. The calculator stores these weights for the common elements and walks through your formula one symbol at a time.
An element symbol is a capital letter, optionally followed by one or more lowercase letters, so C is carbon while Ca is calcium and Cl is chlorine. A number after a symbol is a subscript that tells you how many of that atom appear; when no number is written, the count is one. The tool also understands grouping with parentheses ( ), square brackets [ ], and curly braces { }. A subscript after a closing bracket multiplies everything inside the group, and groups may be nested inside other groups. If the calculator meets a symbol it does not recognize or a bracket that never closes, it treats the whole formula as invalid and returns no result rather than guessing.
Formula
The molar mass is the sum, over every element in the compound, of that element’s standard atomic weight multiplied by the number of its atoms :
For water, , there are two hydrogen atoms and one oxygen atom, so:
When a group is repeated, its whole contents are multiplied by the trailing subscript. For calcium hydroxide, , the group is counted twice:
Worked examples
-
Water, H2O. Two hydrogen atoms and one oxygen: g/mol.
-
Glucose, C6H12O6. Six carbon, twelve hydrogen, and six oxygen atoms: g/mol.
-
Table salt, NaCl. One sodium and one chlorine atom: g/mol.
-
Calcium hydroxide, Ca(OH)2. One calcium plus two hydroxide groups: g/mol.
Each result is rounded to two decimal places, which is more than enough precision for typical lab work and homework.
Notes
The atomic weights used here are the widely quoted standard values; a formula that includes a rare element the calculator does not stock, or a typo such as Xx, will produce no result. The tool assumes a neutral compound and ignores charge, water of crystallisation written with a raised dot, and isotope labels, so a hydrate like CuSO4·5H2O should be entered as its expanded formula. Molar mass is numerically equal to the formula weight in atomic mass units, so the same number that describes one molecule in daltons describes one mole in grams.
FAQs
What units does the result use?
The result is given in grams per mole (g/mol). One mole is Avogadro’s number of particles, about , so the molar mass tells you how many grams of the substance contain that many formula units.
Can I use parentheses and brackets?
Yes. Parentheses ( ), square brackets [ ], and curly braces { } all work, and they can be nested. A subscript after a closing bracket multiplies every atom inside the group, so Ca(OH)2 correctly counts two oxygen and two hydrogen atoms.
Why did I get no result?
The calculator returns nothing when the formula is empty, contains an element symbol it does not recognize, or has brackets that do not match up. Check the capitalisation of your symbols, since Co (cobalt) and CO (carbon monoxide) mean different things, and make sure every opening bracket has a matching closing bracket.