How to calculate molar mass from a chemical formula
Enter the formula in Chemical formula, choose a Result unit, and click Calculate. The result shows the total, the Formula & steps list, and an Element-by-element breakdown. Use the example buttons when you want to check a group or hydrate notation before entering your own formula.
- Enter a formula in Chemical formula, or choose an example such as H2O.
- Select g/mol, kg/mol, or mg/mmol under Result unit.
- Click Calculate to show the molar mass, Formula & steps, and Element-by-element breakdown.
- Click Copy result or Download result (.txt) to keep the output, or click Reset to clear the calculation.
Read the calculation steps
The calculator multiplies each element count by its standard atomic weight in g/mol, then adds the contributions. Its table uses standard atomic weights for naturally occurring element mixtures. The Formula & steps list shows the formula it parsed, each element calculation, and the total.
H2O
H: 2 x 1.008 = 2.016 g/mol
O: 1 x 15.999 = 15.999 g/mol
Total: 18.015 g/mol
What chemical formulas can it read?
Use case-sensitive element symbols, numbers, parentheses, brackets, and a dot or asterisk for a hydrate. In Ca(OH)2, the 2 applies to the whole group. In CuSO4.5H2O and CuSO4*5H2O, the hydrate multiplier adds five water units. Write Co for cobalt; changing its capitalization changes the symbol the parser sees.
- Chemical formula cannot be empty.
- Unknown or unsupported element symbols, unmatched parentheses or brackets, and unsupported characters return an error.
- Element names, trade names, and CAS numbers are not converted into formulas.
- The parser checks the written structure. It does not check chemical plausibility or identify isotope-specific masses.
Convert molar mass to another unit
Choose Result unit to change the displayed total. The calculation uses g/mol first. The kg/mol value divides that number by 1,000, while mg/mmol keeps the same numerical value.
H2O
g/mol: 18.015
kg/mol: 0.018015
mg/mmol: 18.015
After Calculate, Copy result places the plain-text result on the clipboard when clipboard access succeeds. Download result (.txt) creates a text file named molar-mass-calculator-result.txt. The calculator script performs the calculation in the browser from its atomic-weight table and does not send the formula in a request.
Use the example buttons
The buttons under the input fill Chemical formula and calculate immediately. H2O and NaCl show formulas without groups. Ca(OH)2 and Al2(SO4)3 show group multipliers, while CuSO4.5H2O checks hydrate notation. C6H12O6 gives another formula with repeated element counts.
Changing Chemical formula or Result unit hides the current result until you click Calculate again. Reset clears the formula, returns Result unit to g/mol, and hides the result section.
When another science calculator fits better
This page belongs to Science Calculators. Use Chemistry Calculator for pH, molarity, stoichiometry, solution preparation, and the other chemistry calculations listed there. Choose Molarity Calculator when the unknown is concentration from solute amount and solution volume. Choose Dilution Calculator to solve one missing value in C1V1 = C2V2.
Frequently asked questions
How do I calculate molar mass from a formula?
Enter the formula in Chemical formula and click Calculate. The calculator multiplies each atom count by its standard atomic weight, adds the contributions, and shows the Formula & steps list.
Can I calculate the molar mass of a hydrate?
Enter a dot or asterisk before the water count, such as CuSO4.5H2O or CuSO4*5H2O. The parser adds that hydrate segment to the base formula.
Which units does the molar mass calculator support?
Result unit supports g/mol, kg/mol, and mg/mmol. kg/mol is one thousandth of the g/mol value, while mg/mmol has the same numerical value.
Why does my chemical formula return an error?
The formula may be empty, contain an unknown or unsupported symbol, have an unmatched group, or include an unsupported character. Check capitalization, parentheses, brackets, and hydrate separators.