Molar Mass Calculator Formula
Understand the math behind the molar mass calculator. Each variable explained with a worked example.
Formulas Used
Molar Mass
molar_mass = mass_elem_a * count_a + mass_elem_b * count_b + mass_elem_c * count_cVariables
| Variable | Description | Default |
|---|---|---|
mass_elem_a | Atomic Mass of Element A(g/mol) | 12.011 |
count_a | Number of A Atoms | 6 |
mass_elem_b | Atomic Mass of Element B(g/mol) | 1.008 |
count_b | Number of B Atoms | 12 |
mass_elem_c | Atomic Mass of Element C(g/mol) | 15.999 |
count_c | Number of C Atoms | 6 |
How It Works
How to Calculate Molar Mass
Formula
Mw = sum of (atomic mass × count) for each element
Look up atomic masses on the periodic table and multiply by the subscript in the formula.
Worked Example
Glucose C6H12O6: C=12.011, H=1.008, O=15.999.
mass_elem_a = 12.011count_a = 6mass_elem_b = 1.008count_b = 12mass_elem_c = 15.999count_c = 6
- 01C: 12.011 × 6 = 72.066
- 02H: 1.008 × 12 = 12.096
- 03O: 15.999 × 6 = 95.994
- 04Mw = 72.066 + 12.096 + 95.994 = 180.156 g/mol
Ready to run the numbers?
Open Molar Mass Calculator