UTILS.
Private by default
M

Molar Mass Calculator

Type a chemical formula to get its molar mass in g/mol and a per-element breakdown.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

Molar Mass Calculator adds up the standard atomic weights in a chemical formula and reports the molar mass in grams per mole. Type a formula such as H2O, Ca(OH)2 or C6H12O6. Two tiles show the molar mass (rounded to three decimals) and the total number of atoms, and a breakdown lists each element's count, its atomic weight, its contribution in g/mol and its percentage of the total mass.

The parser handles nested groups in round, square or curly brackets with their own multipliers, such as Al2(SO4)3 or K4[Fe(CN)6]. Hydrates and adducts can be written with a middle dot, bullet or asterisk, for example CuSO4·5H2O, where the number in front of a part multiplies it. Element symbols are case-sensitive: Co is cobalt, while CO is carbon and oxygen. All 118 elements are included, using conventional IUPAC atomic weights with a few decimals, which suits coursework and lab prep. For very high precision, use isotope-specific data.

If a symbol is unknown the error names it, and unbalanced brackets or stray characters show a generic parse error. Charges, isotopes such as 13C, and fractional subscripts are not supported. Everything runs in your browser and nothing is uploaded.

Frequently asked questions

Are parentheses and hydrates supported?
Yes. Round, square and curly brackets can be nested and followed by a multiplier, so Ca3(PO4)2 and K4[Fe(CN)6] work. Hydrates can be separated with a middle dot, bullet or asterisk, as in CuSO4·5H2O. Because a full stop also acts as a separator, do not use decimal points in a formula.
Why does capitalization matter?
Element symbols are case-sensitive. A capital letter starts a new element and lowercase letters complete it, so Co is cobalt but CO is carbon and oxygen. A lowercase letter at the start of an element is rejected as a character the parser cannot read.
What happens with an invalid symbol or formula?
An unrecognised symbol, such as Xx, shows an error naming it. Unbalanced brackets, charges like +, isotope prefixes and other stray characters give a general could-not-parse message and no result.
Which atomic weights are used?
Conventional IUPAC standard atomic weights for elements 1 to 118, rounded to a few decimals. For radioactive elements without a stable isotope the mass number of a common isotope is used. Results are rounded to three decimals.

More tools