Mole Fraction Calculator

Find the mole fraction of a mixture component.

How it is calculated

This tool handles a mixture of exactly two components. You enter the amount of each in moles, and it computes xA = nA / (nA + nB) and xB = nB / (nA + nB). Both results are dimensionless and shown with four decimals; they always add up to 1.

Amounts cannot be negative, and the total must be above zero, otherwise there is no result. If you have grams rather than moles, divide each mass by its molar mass first (the tool does not do this). For three or more components, divide each component's moles by the sum of all of them yourself.

Worked example

A mixture contains 2 mol of component A and 6 mol of component B. Total moles: 2 + 6 = 8. Then xA = 2 ÷ 8 = 0.2500 and xB = 6 ÷ 8 = 0.7500. Check: 0.2500 + 0.7500 = 1. If the total pressure were 4 atm and the mixture were an ideal gas, component B's partial pressure would be 0.75 × 4 = 3 atm.

Try this example →

Common mistakes

  • Entering grams instead of moles. Convert each mass using its molar mass before using the tool.
  • Dividing by the other component's moles instead of the total, which gives a ratio (here 2/6) rather than a fraction.
  • Confusing mole fraction with mass fraction or mole percent; multiply by 100 yourself if you need percent.
  • Leaving out a component and so understating the total: for a three-component mixture this two-component tool gives wrong fractions.
  • Using volume or molarity in place of moles; only the amount of substance counts.

About this calculator

Mole fraction expresses the composition of a mixture as xᵢ = nᵢ / n_total — the moles of one component divided by the total moles of all components in the mixture. Unlike mass percent or molarity, it's a dimensionless ratio that always sums to 1 across every component, which makes it the natural unit for describing gas and liquid mixtures in thermodynamic equations.

Chemists and chemical engineers rely on mole fraction in Raoult's law (a component's vapor pressure equals its mole fraction times the pure-liquid vapor pressure) and Dalton's law of partial pressures (partial pressure equals mole fraction times total pressure), both central to distillation design, phase-equilibrium calculations, and gas-mixture analysis. Students use it in stoichiometry and physical chemistry labs whenever a problem calls for composition independent of volume or mass.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators