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

Frequently Asked Questions

What is mole fraction?

Mole fraction is the ratio of moles of one component to the total moles in the mixture. It ranges from 0 to 1.

Why must mole fractions sum to 1?

Because they represent proportions of the whole mixture.

How is mole fraction related to partial pressure?

By Dalton's law, partial pressure of a gas equals its mole fraction times total pressure: P_i = X_i × P_total.

Ready to run the numbers?

Open Mole Fraction Calculator