dopecalc

Molar Mass Calculator

Calculate the molar mass of a chemical compound from its formula. Enter a formula like H2O or NaCl and see the element-by-element breakdown.

Enter a chemical formula (e.g., H2O, NaCl, C6H12O6) to compute its molar mass. The calculator parses the formula and shows an element-by-element breakdown.

About this Calculator

Calculate the molar mass of a chemical compound from its formula. Enter a formula like H2O or NaCl and see the element-by-element breakdown.

Formula & Calculations

Formula

M = Σ(atomic mass of element × count of atoms in formula)
Where:
  • M=Molar mass — grams per mole (g/mol)
  • formula=Chemical formula (e.g., H2O, C6H12O6, CaCO3)

Assumptions

  • Atomic masses use standard values: H=1.008, C=12.011, N=14.007, O=15.999, Na=22.990, Cl=35.453, etc.
  • Formulas are parsed by splitting on uppercase letters.
  • Subscripts must be integers (no decimal subscripts).
  • Parentheses and hydrate notation are not supported in the basic parsing.

Calculation Examples

Example 1

Inputs:H2O
Result:Molar Mass = 18.015 g/mol

2×H (2.016) + 1×O (15.999) = 18.015 g/mol.

Example 2

Inputs:NaCl
Result:Molar Mass = 58.443 g/mol

1×Na (22.990) + 1×Cl (35.453) = 58.443 g/mol.

Example 3

Inputs:C6H12O6
Result:Molar Mass = 180.156 g/mol

6×C (72.066) + 12×H (12.096) + 6×O (95.994) = 180.156 g/mol.

Frequently Asked Questions

How do I write chemical formulas?

Use element symbols with the first letter capitalized (e.g., H, O, Na, Cl). Follow with numbers for subscripts: H2O for water, H2SO4 for sulfuric acid. The calculator parses by capital letters.

Can this handle formulas with parentheses?

The basic parser handles simple formulas without parentheses. For complex formulas like Ca(OH)2, manually expand to CaO2H2 for now.