Mole Fraction Calculator
Enter the moles of each component; using xᵢ = nᵢ / Σn the tool instantly computes each component's mole fraction, which always sums to 1.
Input Data
Results
At a glance:The mole fraction (symbol x, sometimes X) is a dimensionless way to express the composition of a mixture: 'the mole count of a component divided by the total moles of the mixture' = xᵢ = nᵢ / Σn (Σn is the sum over all components). Its biggest advantage is being unitless and always adding up to 1 (or 100% as mole percent), so it is ideal for comparing compositions. In a gas mixture, by Dalton's law a component's partial pressure Pᵢ = xᵢ × P_total, so the mole fraction is also the volume fraction (for ideal gases). Using this tool's default: a binary mixture of n₁ = 2 mol and n₂ = 8 mol, total Σn = 10 mol, x₁ = 2/10 = 0.2, x₂ = 8/10 = 0.8, summing to 1. Air is a classic example: oxygen x ≈ 0.21, nitrogen x ≈ 0.78, argon ≈ 0.009. The mole-fraction calculator supports 2 or 3 components, and also reports each component's mole percent (= x × 100%). Notes: first, the mole fractions of all components always sum to 1, a quick check. Second, each nᵢ can use any consistent unit (mol, mmol), the ratio is what matters, but they must share a unit. Third, it is the mole ratio, not mass ratio; to convert to mass fraction you also need the molar masses. Fourth, for an ideal gas mixture the mole fraction equals the volume fraction. Fifth, all entered nᵢ must be non-negative and at least one positive. In short, this simple xᵢ = nᵢ/Σn is the bridge from 'microscopic mole counts' to 'macro-mixture composition', used everywhere in gas mixtures, solutions and alloy composition.
Formula
Mole fraction: xᵢ = nᵢ / Σn (Σn is total moles).
All mole fractions sum to 1 (x₁ + x₂ + … = 1).
Mole percent = xᵢ × 100%.
For ideal gas, mole fraction = volume fraction, and Pᵢ = xᵢ × P_total (Dalton's law).
$$x_i = \dfrac{n_i}{\sum_j n_j}$$How to Use
- Select the number of components (2 or 3).
- Enter each component's moles nᵢ (same unit).
- The right panel instantly shows each xᵢ and the mole percent; they sum to 1.
Mole fractions in common gas mixtures
| Mixture | Component | Mole Fraction x |
|---|---|---|
| Air | Oxygen O₂ | ≈ 0.21 |
| Air | Nitrogen N₂ | ≈ 0.78 |
| Air | Argon Ar | ≈ 0.009 |
| Ammonia synthesis gas | N₂ : H₂ = 1 : 3 | 0.25 / 0.75 |
Mole fractions sum to 1; for ideal gases they equal volume fractions.
Case Studies
Binary mixture
n₁ = 2 mol, n₂ = 8 mol; total Σn = 10 mol.
x₁ = 2/10 = 0.2, x₂ = 8/10 = 0.8, summing to 1.
Mole percents 20% and 80%.
Approximate composition of air
Oxygen x ≈ 0.21, nitrogen x ≈ 0.78, argon ≈ 0.009 — summing near 1.
By Dalton's law with total pressure 101.3 kPa, oxygen partial pressure ≈ 0.21 × 101.3 ≈ 21.3 kPa.
This is why the mole fraction is a direct input to partial-pressure calculations.
FAQ
Why do mole fractions sum to 1?
Because xᵢ = nᵢ / Σn, summing over all i gives Σxᵢ = Σnᵢ / Σn = 1. This is the defining property of the mole fraction and a quick check on your result.
What is the difference between mole fraction and mass fraction?
Mole fraction is mole ratio (nᵢ/Σn), mass fraction is mass ratio (mᵢ/Σm); they can differ greatly for different molar masses. To convert between them you need the molar masses of each component.
Why does the mole fraction equal the volume fraction for gases?
For ideal gases, the volume of each component at the same T, P is proportional to its moles (Avogadro's law), so the mole fraction equals the volume fraction, and thus also equals the partial-pressure fraction by Dalton's law.
Can I use mmol instead of mol?
Yes. The formula only uses the ratio nᵢ/Σn; as long as every nᵢ uses the same unit (all mol or all mmol), the ratio and xᵢ are the same. Just keep them consistent.
What are the uses of the mole fraction?
It is used for gas-mixture composition, solution concentration (especially for colligative properties and Raoult's law), Dalton's partial-pressure calculations, and alloy composition — a dimensionless and ubiquitous composition measure.
Related Tools
References
Content review: Calculatorism Science Team. Results are for reference only; please refer to the relevant authorities for the official figures.