Home/Calculators/Chemistry/Mole Fraction Calculator

Mole Fraction Calculator

Find the mole fraction of one component in a two-component mixture.

mole-fraction-calculator
Result
—
In summary: Mole fraction of A is its moles divided by the total moles: x_A = moles A ÷ (moles A + moles B). With 2 mol of A and 3 mol of B, x_A = 2 ÷ (2 + 3) = 0.4.

Mole fraction formula

The mole fraction of a component is its moles divided by the total moles of all components: x_A = moles A ÷ (moles A + moles B). Mole fractions are dimensionless and always add up to 1 across all components. They appear in Raoult's law and Dalton's law of partial pressures. For mass-based concentration instead, use the molality calculator.

How to use this calculator

Enter the moles of component A and the moles of component B. The calculator adds them for the total and divides A by the total, then also shows the mole fraction of B so you can confirm the two fractions sum to 1. A zero total is rejected. Every component has to be expressed in moles first, which is what the moles calculator is for.

Worked example

A mixture has 2 mol of A and 3 mol of B, giving 5 mol total. x_A = 2 ÷ 5 = 0.4 and x_B = 3 ÷ 5 = 0.6. As expected, 0.4 + 0.6 = 1.

In a gas mixture that same 0.4 is also the fraction of total pressure contributed by A, which is exactly what Dalton's law states. Weighting by mass rather than by particle count gives mass percent instead.

Frequently asked questions

What is a mole fraction?
A mole fraction is the ratio of the moles of one component to the total moles of all components in a mixture. It has no units.
Do mole fractions add up to 1?
Yes. The mole fractions of every component in a mixture always sum to exactly 1 (or 100% if expressed as a percentage).
Can I extend this to more than two components?
Yes. The mole fraction of any component is its moles divided by the grand total of all components' moles.
Why use moles instead of mass?
Mole fraction reflects the number of particles, which is what matters for colligative properties and partial pressures, not the mass of each component.
How do I get moles if I only know the mass?
Divide each mass by that substance's molar mass in g/mol before entering the values. Skipping this step and typing masses straight in gives a mass fraction, not a mole fraction, and the two differ whenever the components have different molar masses.
How this tool works

The formula behind this tool is written out in full in the sections above, so you can check the maths yourself. Every calculator on Calculorium is verified against worked examples with automated tests before it is published, and pages are reviewed as formulas or standards change. Nothing you type is sent anywhere — the calculation runs entirely in your browser. Read how we build and check these tools.

Last updated: July 27, 2026 · Calculations run in your browser. Estimates for information only.