Mole Fraction Calculator
Enter the moles of two components to get the mole fraction of each — a dimensionless ratio between 0 and 1, with both values always summing to 1.
Both fractions at once
Enter the moles of A and B and the calculator returns the mole fraction of each component (x = n / total), which together sum to exactly 1.
Use moles, not grams
Mole fraction divides moles by moles. If you only have masses, convert each to moles by dividing by its molar mass before you start.
What is mole fraction?
Composition by amount of substance
The mole fraction is the proportion of a mixture made up by one component, measured by amount of substance rather than by mass or volume. This mole fraction calculator divides the moles of one component by the total moles of every component, turning two amounts into a dimensionless ratio between 0 and 1. Because it counts particles rather than weighing them, mole fraction is the natural way to describe gas mixtures and ideal solutions, and it appears throughout chemistry in Dalton's law of partial pressures, Raoult's law, and Henry's law.
Enter the moles of component A and component B to get the mole fraction of each instantly — the two values always add up to 1.
The mole fraction of a component is its amount in moles divided by the total moles of all components in the mixture.
x_A = nA / (nA + nB)The total moles in the denominator are the sum of every component, so the fraction is always between 0 and 1. The mole fraction of B follows the same rule, x_B = nB / (nA + nB), and because the two numerators add up to the denominator, the fractions always sum to exactly 1. That means once you know x_A you also know x_B = 1 − x_A.
Suppose a mixture contains 2 mol of component A and 3 mol of component B.
Add up the total moles
2 + 3 = 5 mol — the total amount of substance in the mixture.
Divide A by the total
2 / 5 = 0.4 — the mole fraction of component A.
Divide B by the total
3 / 5 = 0.6 — the mole fraction of component B. Notice that 0.4 + 0.6 = 1, the check that confirms the result.
Each mole fraction tells you what share of the particles in the mixture belongs to that component. A mole fraction of 0.4 means 40% of the molecules are component A; multiply by 100 to read it as mole percent (40 mol%). Because the fractions sum to 1, they make composition easy to reason about: in a two-component mixture, raising one fraction must lower the other by the same amount. This matters in practice because many laws use mole fraction directly — under Dalton's law, a gas with a mole fraction of 0.4 contributes 40% of the total pressure as its partial pressure, and under Raoult's law a solvent's mole fraction sets the fraction of its pure vapour pressure that the solution shows. Working in amount of substance rather than mass keeps these relationships linear and clean.
The formula is exact, but a couple of practical points are worth keeping in mind.
Two components and consistent amounts
This calculator handles a two-component mixture. For three or more components, the same rule applies but with every component in the total: x_i = n_i divided by the sum of all moles. Always enter amounts in moles, not grams — if you have masses, convert each to moles using its molar mass first, or the fractions will be wrong.