Mole Fraction Calculator
Compute each component’s mole fraction xi in a mixture. Enter moles directly or provide mass with molar mass. Optionally enter total pressure to get partial pressures.
Background
The mole fraction (xi) expresses how many moles of one component are present relative to the total moles in the mixture. It’s a dimensionless way to describe composition that remains constant with temperature or pressure changes — unlike molarity.
For a component i with moles ni and total moles ntot, the mole fraction is given by:
xi = ni / ntot
For gas mixtures, Dalton’s Law relates it to partial pressure: Pi = xi · Ptot.
How to use this calculator
- Choose 2–5 components and fill each row.
- Give moles or mass + molar mass per component.
- Optional: provide Ptot to see partial pressures.
Formula & Equation Used
Total moles: ntot = Σ ni
Mole fraction: xi = ni / ntot (with Σ xi = 1)
From mass: ni = mi / Mi
Dalton’s Law (optional): Pi = xi · Ptot
Example Problems & Step-by-Step Solutions
Example 1 — Binary solution (moles given)
n(A) = 0.40 mol, n(B) = 0.60 mol → ntot = 1.00 mol.
xA = 0.40/1.00 = 0.400; xB = 0.60/1.00 = 0.600.
Example 2 — Gas mixture with Ptot
n(N₂)=0.60 mol, n(O₂)=0.30 mol, n(Ar)=0.10 mol; Ptot = 1.00 atm.
ntot=1.00 mol → x(N₂)=0.60, x(O₂)=0.30, x(Ar)=0.10.
P(N₂)=0.60 atm; P(O₂)=0.30 atm; P(Ar)=0.10 atm.
Example 3 — From masses and molar masses
m(A)=10.0 g (M=50.0 g·mol⁻¹) → n(A)=0.200 mol; m(B)=18.0 g (M=18.0 g·mol⁻¹) → n(B)=1.00 mol.
ntot=1.200 mol → xA=0.167; xB=0.833.
Frequently Asked Questions
Q: Do mole fractions sum to 1?
Yes. By definition Σxi = 1 (within rounding).
Q: Can I enter masses instead of moles?
Yes. Provide mass and molar mass; we convert to moles internally.
Q: How are partial pressures computed?
Dalton’s Law: Pi = xi·Ptot. Supply Ptot and a unit.