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

VariableDescriptionDefault
moles_aMoles of Component A(mol)2
moles_bMoles 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
  1. 01Total moles = 2 + 3 = 5
  2. 02X_A = 2 / 5 = 0.4
  3. 03X_B = 3 / 5 = 0.6

Ready to run the numbers?

Open Mole Fraction Calculator