Molecular Weight Calculator Formula
Understand the math behind the molecular weight calculator. Each variable explained with a worked example.
Formulas Used
Molecular Weight
mw = c_atoms * 12.011 + h_atoms * 1.008 + o_atoms * 15.999 + n_atoms * 14.007 + s_atoms * 32.065Variables
| Variable | Description | Default |
|---|---|---|
c_atoms | Number of Carbon Atoms | 6 |
h_atoms | Number of Hydrogen Atoms | 12 |
o_atoms | Number of Oxygen Atoms | 6 |
n_atoms | Number of Nitrogen Atoms | 0 |
s_atoms | Number of Sulfur Atoms | 0 |
How It Works
Molecular Weight Calculation
The molecular weight (molar mass) of a compound is the sum of the atomic weights of all atoms in its molecular formula.
Formula
MW = sum(n_i × AW_i)
where n_i is the number of atoms of element i and AW_i is the standard atomic weight. Standard atomic weights: C = 12.011, H = 1.008, O = 15.999, N = 14.007, S = 32.065 g/mol.
Worked Example
Calculate the molecular weight of glucose (C6H12O6).
c_atoms = 6h_atoms = 12o_atoms = 6n_atoms = 0s_atoms = 0
- 01C contribution: 6 × 12.011 = 72.066
- 02H contribution: 12 × 1.008 = 12.096
- 03O contribution: 6 × 15.999 = 95.994
- 04MW = 72.066 + 12.096 + 95.994 = 180.156 g/mol
Ready to run the numbers?
Open Molecular Weight Calculator