Atomic Mass Calculator
Calculate molecular weight of any chemical compound from its formula. Supports nested parentheses, hydrates, brackets, and all 118 elements.
About
Molecular weight errors propagate through every downstream calculation in chemistry: stoichiometry, molarity, yield prediction, and dosimetry. A single misidentified isotope or forgotten hydrate notation can shift a result by tens of grams per mole. This calculator parses chemical formulas using a recursive descent algorithm that correctly handles nested parentheses like Ca3(PO4)2, bracketed groups, coefficients, and hydrate notation (·). All atomic weights follow IUPAC 2021 standard values. For elements with no stable isotopes (e.g., Tc, Pm), the mass number of the longest-lived isotope is used, consistent with IUPAC convention.
The tool decomposes any valid formula into its elemental constituents with individual mass contributions and percentage composition. Note: this calculator uses standard atomic weights, not exact isotopic masses. For mass spectrometry or nuclear applications, isotope-specific data is required. Pro tip: always verify hydrate state of your reagents. Anhydrous CuSO4 (159.61 g/mol) versus CuSO4⋅5H2O (249.69 g/mol) differ by 56%.
Formulas
The molecular weight M of a compound is the sum of atomic weights of all constituent atoms, each multiplied by their count in the formula:
Where M = molecular weight in g/mol (numerically equal to unified atomic mass units, u). Ni = number of atoms of element i in the molecular formula. Ar,i = standard atomic weight of element i per IUPAC. n = number of distinct elements.
The mass fraction (percentage composition) of element i is computed as:
For hydrates, the formula X⋅nH2O is parsed as the sum of the anhydrous compound mass plus n times the mass of water (18.015 g/mol).
Reference Data
| Z | Symbol | Element Name | Atomic Weight (u) | Group | Period |
|---|---|---|---|---|---|
| 1 | H | Hydrogen | 1.008 | 1 | 1 |
| 2 | He | Helium | 4.0026 | 18 | 1 |
| 6 | C | Carbon | 12.011 | 14 | 2 |
| 7 | N | Nitrogen | 14.007 | 15 | 2 |
| 8 | O | Oxygen | 15.999 | 16 | 2 |
| 11 | Na | Sodium | 22.990 | 1 | 3 |
| 12 | Mg | Magnesium | 24.305 | 2 | 3 |
| 13 | Al | Aluminium | 26.982 | 13 | 3 |
| 14 | Si | Silicon | 28.086 | 14 | 3 |
| 15 | P | Phosphorus | 30.974 | 15 | 3 |
| 16 | S | Sulfur | 32.06 | 16 | 3 |
| 17 | Cl | Chlorine | 35.45 | 17 | 3 |
| 19 | K | Potassium | 39.098 | 1 | 4 |
| 20 | Ca | Calcium | 40.078 | 2 | 4 |
| 26 | Fe | Iron | 55.845 | 8 | 4 |
| 29 | Cu | Copper | 63.546 | 11 | 4 |
| 30 | Zn | Zinc | 65.38 | 12 | 4 |
| 35 | Br | Bromine | 79.904 | 17 | 4 |
| 47 | Ag | Silver | 107.868 | 11 | 5 |
| 53 | I | Iodine | 126.904 | 17 | 5 |
| 56 | Ba | Barium | 137.327 | 2 | 6 |
| 78 | Pt | Platinum | 195.084 | 10 | 6 |
| 79 | Au | Gold | 196.967 | 11 | 6 |
| 80 | Hg | Mercury | 200.592 | 12 | 6 |
| 82 | Pb | Lead | 207.2 | 14 | 6 |
| 92 | U | Uranium | 238.029 | - | 7 |