Mole Fraction Calculator Formula
Understand the math behind the mole fraction calculator. Each variable explained with a worked example.
Formulas Used
Mole Fraction of A
fraction_a = moles_a / (moles_a + moles_b)Mole Fraction of B
fraction_b = moles_b / (moles_a + moles_b)Variables
| Variable | Description | Default |
|---|---|---|
moles_a | Moles of Component A(mol) | 2 |
moles_b | Moles of Component B(mol) | 3 |
How It Works
How to Calculate Mole Fraction
Formula
X_A = n_A / (n_A + n_B)
Mole fractions are dimensionless and always sum to 1.
Worked Example
A mixture of 2 mol ethanol and 3 mol water.
moles_a = 2moles_b = 3
- 01Total moles = 2 + 3 = 5
- 02X_A = 2 / 5 = 0.4
- 03X_B = 3 / 5 = 0.6
Ready to run the numbers?
Open Mole Fraction Calculator