Mole Fraction Calculator (amount-of-substance fraction)
Free mole fraction calculator — x = n/n_total for a binary mixture. Work from moles, masses or molality, and convert to mole percent and mass percent.
Mole Fraction Calculator
Background.
Mole fraction is the proportion of a mixture's particles that belong to one component: x₁ = n₁ ÷ (n₁ + n₂). It counts entities rather than grams or millilitres, which makes it dimensionless, makes the fractions of all components sum to exactly one, and makes it completely independent of temperature and pressure. This calculator handles binary mixtures — two components in, two fractions out — and will take your composition as moles, as masses, or as a molality, then report the mole fraction, the mole percent and the mass percent side by side.
The reason to count particles rather than mass is that most of the physical chemistry that cares about composition also counts particles. Raoult's law says a component's partial vapour pressure is its mole fraction times its pure vapour pressure. Dalton's law says a gas's partial pressure is its mole fraction times the total. Every colligative property — freezing-point depression, boiling-point elevation, osmotic pressure — depends on how many solute particles are present and not at all on what they weigh. When a relationship is about the number of things, the concentration unit needs to be about the number of things too.
Both standards bodies define it the same way and disagree only on what to call it. The IUPAC Green Book lists three accepted names in its composition table — mole fraction, amount-of-substance fraction, and amount fraction — with mole fraction first. NIST Special Publication 811 gives the identical equation in section 8.6.2 but prefers "amount-of-substance fraction of B", on the grounds that a quantity's name should not contain the name of a unit, just as we say mass fraction rather than kilogram fraction. This page uses "mole fraction" in its heading because that is the name people search for, and mentions NIST's preference because a reader writing a paper needs to know it.
One thing worth being clear about up front: this page is exact and assumes nothing. Mole fraction is a bookkeeping ratio, so it holds for any mixture — ideal, non-ideal, associating, electrolyte — with no approximation whatsoever. It is the laws that consume a mole fraction that assume ideality, not the fraction itself. Raoult's law is an idealisation. Dalton's law is an idealisation for real gases. The colligative equations are idealisations for dilute solutions. The number this calculator returns is not.
The most useful thing the page shows is the gap between mole percent and mass percent. Mix 46.069 g of ethanol with 100 g of water and ethanol is 31.5 percent of the mixture by mass but only 15.3 percent of it by particle count, because an ethanol molecule weighs about two and a half times what a water molecule does. Heavier components always take a larger share of the mass than of the amount. Confusing the two is one of the most common composition errors in introductory chemistry, and the two figures sit next to each other here so the difference is impossible to miss.
Below the widget you will find the definition as both authorities state it, the derivation of the molality conversion, the hand-computed ethanol-and-water example the tests are built from, and the domain edges — including why a mole fraction outside the range 0 to 1 is rejected rather than being quietly clamped.
What is mole fraction calculator?
The mole fraction of a component, symbol x (or y for gaseous mixtures), is the amount of substance of that component divided by the total amount of substance in the mixture: x_B = n_B ÷ Σn. Because both numerator and denominator are amounts in moles, the ratio is a pure number with SI unit one — it carries no dimension at all. For a binary mixture the two fractions always add to exactly 1, so knowing one gives you the other.
The IUPAC Green Book, third edition, lists it in the section 2.10 composition table as 'mole fraction, amount-of-substance fraction, amount fraction' with the definition x_B = n_B/Σᵢnᵢ and SI unit 1. Its note 10 records the convention that x is used for condensed phases while y may be used for gaseous mixtures. NIST Special Publication 811, section 8.6.2, gives the same definition independently, adds the explicit statement that amount-of-substance fraction is 'a quantity of dimension one', and records its preference for that longer name over 'mole fraction'.
A mole fraction can be written as a percentage. NIST section 7.10.2 gives the example x_B = 0.0025 = 0.25 %, while cautioning against writing 'percentage by amount of substance' or '% (mol/mol)' — the percent sign means only the number 0.01 and cannot carry extra information. The clean forms are 'the amount-of-substance fraction is 15 %' or 'x = 0.15', and NIST also permits the ratio form x_B = 185 mmol/mol.
Because it involves no volume, mole fraction shares molality's key virtue: it does not change when you heat or cool the mixture. Molarity does. That is why phase diagrams, vapour–liquid equilibrium data and thermodynamic activity are all expressed in mole fraction, and why a mole fraction quoted at one temperature can be used at another without correction.
How to use this calculator.
- Decide which component is 'component 1'. Everything the calculator reports as a primary figure refers to that one. For a solution it is usually the solute; for a vapour mixture, whichever component you are interested in.
- Pick the mode that matches what you actually measured. Masses are the most common starting point in a teaching lab; moles are more common when the amounts came from a reaction; molality is what a colligative-property problem hands you.
- Enter both molar masses. They are required in every mode, because the mass percent output needs them even when the mole fraction does not. Sum the atomic masses of the exact formula, hydrate water included.
- For the 'both masses' mode, enter grams for each component. The calculator converts each to moles first, then takes the ratio — never take a ratio of masses and call it a mole fraction.
- For the molality mode, enter the molality of component 1 and the molar mass of the solvent. The calculation uses a basis of exactly one kilogram of solvent, which contains 1000 ÷ M₂ moles: for water that is 55.51 mol.
- For the 'convert to mass percent' mode, enter a mole fraction between 0 and 1. If you have a mole percent, divide it by 100 first — 15.3 % goes in as 0.153.
- Compare the two percentages before you leave the page. If the mole percent and the mass percent are far apart, the two molar masses are far apart, and any calculation that mixes the two units will be badly wrong.
The formula.
The definition is one line, and every mode is that line with the amounts arrived at differently.
x₁ = n₁ / (n₁ + n₂) definition, binary mixture x₂ = n₂ / (n₁ + n₂) and x₁ + x₂ = 1 identically nᵢ = mᵢ / Mᵢ amounts from masses x₁ = b / (b + 1000/M₂) amounts from a molality w₁ = n₁M₁ / (n₁M₁ + n₂M₂) mass fraction from amounts
The molality conversion deserves its derivation, because it looks like it came from nowhere. Take a basis of exactly one kilogram of solvent. By the definition of molality, that kilogram holds b moles of solute. The kilogram itself is 1000 grams of a substance of molar mass M₂ grams per mole, so it is 1000/M₂ moles of solvent — for water, 1000/18.015 = 55.5093 mol. Substitute both into the definition of mole fraction and you get x₁ = b/(b + 1000/M₂). Nothing else is assumed.
The conversion to mass percent works the same way in reverse. On a basis of one mole of mixture there are x₁ moles of component 1 weighing x₁M₁ grams and x₂ moles of component 2 weighing x₂M₂ grams, so the mass fraction of component 1 is x₁M₁ ÷ (x₁M₁ + x₂M₂). This is where the two percentages diverge. If M₁ is larger than M₂, the numerator is inflated more than the denominator and the mass percent exceeds the mole percent. If M₁ is smaller, the reverse happens. They coincide only when the two molar masses are equal.
Rounding: every intermediate is a full-precision Decimal and rounding happens once, at the return boundary, to ten decimal places. Because nothing is rounded part-way through, the identity x₁ + x₂ = 1 holds to the full precision the outputs carry, which the unit tests assert at compositions from x = 0 through to x = 1.
Invalid domain, stated plainly because a clamped value would be worse than an error. A mole fraction outside the interval from 0 to 1 is rejected: a component cannot be more than all of the mixture, and it cannot be less than none of it. A molar mass of zero or less is rejected. A negative amount or mass is rejected. And a mixture with zero total amount of substance is rejected, because 0/0 is not a composition — it is the absence of one. The endpoints themselves are legal: x = 0 and x = 1 describe a pure component, and the calculator returns them exactly.
A worked example.
Mix 46.069 g of ethanol with 100.000 g of water and work out the composition both ways. Ethanol is C2H6O with a molar mass of 46.069 g/mol and water is 18.015 g/mol, both summed from the IUPAC/CIAAW 2021 abridged atomic weights. Convert each mass to an amount first: the ethanol is 46.069 ÷ 46.069 = 1.000 000 mol, chosen deliberately to make the arithmetic transparent, and the water is 100.000 ÷ 18.015 = 5.550 930 mol. The mixture therefore contains 6.550 930 mol of molecules in total. The mole fraction of ethanol is 1.000 000 ÷ 6.550 930 = 0.152 650, so ethanol accounts for 15.2650 percent of the particles, and water's fraction is 0.847 350, or 84.7350 percent. The two add to exactly 1. Now compare that with the mass figures. Ethanol is 46.069 g out of a total 146.069 g, which is 31.5392 percent by mass. The same mixture is 15.27 percent ethanol by particle count and 31.54 percent ethanol by mass — a factor of more than two apart. The reason is that an ethanol molecule weighs 46.069/18.015 = 2.5573 times what a water molecule weighs, so the heavier component claims a bigger share of the mass than of the count. This is the direction to remember: the heavier component's mass percent is always above its mole percent. Swap the labels — put 100 g of water in as component 1 and 46.069 g of ethanol as component 2 — and the inequality flips, because water is now the lighter component. If you were about to substitute a mass percent into Raoult's law or into a colligative equation, this example is the reason not to.
Frequently asked questions.
What is the difference between mole fraction and mass percent?
Do mole fractions always add up to 1?
Does mole fraction change with temperature?
How do I convert molality to mole fraction?
Should I call it 'mole fraction' or 'amount-of-substance fraction'?
Can a mole fraction be greater than 1 or negative?
Does this work for mixtures of more than two components?
References& sources.
- [1]IUPAC, 'Quantities, Units and Symbols in Physical Chemistry' (the Green Book), 3rd edition, 2nd printing 2012 (ISBN 978-0-85404-433-7), section 2.10, composition-of-mixtures table: 'mole fraction, amount-of-substance fraction, amount fraction', symbols x and y, definition x_B = n_B/Σᵢnᵢ, SI unit 1, with note 10 giving the x-for-condensed-phases and y-for-gases convention. Free full-text searchable PDF; retrieved 2026-07-29.
- [2]NIST Special Publication 811, 2008 edition, section 8.6.2 'Mole fraction of B; amount-of-substance fraction of B' — quantity symbol x_B (also y_B), SI unit one (1), 'ratio of the amount of substance of B to the amount of substance of the mixture: x_B = n_B/n', with note 1 recording NIST's preference for the name 'amount-of-substance fraction'. Consulted as an authority independent of IUPAC; it agrees on every element of the definition. Retrieved 2026-07-29.
- [3]NIST Special Publication 811, 2008 edition, section 7.10.2 '%, percentage by, fraction', worked example: 'x_B = 0.0025 = 0.25 %', together with the instruction to avoid '% (mol/mol)' and 'percentage by amount of substance', and the permitted ratio form x_B = 185 mmol/mol. Used as this page's independent numeric cross-check of the mole-percent output. Retrieved 2026-07-29.
- [4]IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), Standard Atomic Weights 2021, abridged values — used to build the default molar masses on this page: carbon 12.011, hydrogen 1.008, oxygen 15.999, giving M(C2H6O) = 46.069 g/mol and M(H2O) = 18.015 g/mol. Retrieved 2026-07-29.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 682 calculators remain free
- No billing is enabled