Chemistry · Solution Chemistry
Mole fraction calculator icon showing a mixture of two kinds of molecules in a beaker

Mole fraction calculator

This mole fraction calculator finds the mole fraction and mole percent of every component in a mixture of up to five substances, from their formulas and their masses or amounts in moles, with the average molar mass of the mixture.

Enter each component as a chemical formula so its molar mass can be calculated. Amounts can be masses or moles, and you can mix the two: for example 3.0 mol of NaCl with 1.00 kg of water.

Mole fraction calculator for a mixture

Fill in at least two components; leave the formula empty for unused rows.

How to use the mole fraction calculator

In the mole fraction calculator, type the formula of each component (C2H6O2, H2O, NaCl, N2…) and its amount, and choose whether that amount is a mass (mg, g, kg, lb) or an amount of substance (mmol, mol, kmol). The mole fraction calculator works out each molar mass from the formula, converts every mass to moles, and lists the mole fraction, mole percent and mass fraction of each component, together with the total amount and the average molar mass of the mixture. Rows with an empty formula are ignored, so you can use two, three, four or five components. If you know a composition in wt % rather than grams, enter it as grams of a 100 g sample: 50 wt % ethanol becomes 50 g of C2H5OH and 50 g of H2O.

Mole fraction formula behind the mole fraction calculator

The mole fraction of a component is its amount in moles divided by the total amount of all components in the mixture:

xi = ni / (n1 + n2 + … + nk) with ni = mi / Mi and Σ xi = 1

Mole fraction has no unit, lies between 0 and 1, and all mole fractions of a mixture add up to exactly 1. Multiplying by 100 gives the mole percent (mol %). IUPAC calls the same quantity the amount fraction (IUPAC Gold Book) and notes that it also equals the fraction of molecules, since a mole is a fixed number of particles. That is why mole fraction is the natural composition variable for gases, for Raoult’s law and for colligative properties: these depend on how many particles there are, not on how heavy they are. Liquids are usually written x and gases y, but the definition is the same.

How to calculate mole fraction: worked example with the mole fraction calculator

OpenStax Chemistry 2e, Example 11.3, considers an antifreeze solution made from 2.22 × 10³ g of ethylene glycol (C₂H₆O₂) and 2.00 × 10³ g of water. These are the default values of the mole fraction calculator.

Step 1, molar masses. M(C₂H₆O₂) = 2 × 12.011 + 6 × 1.008 + 2 × 15.999 = 62.068 g/mol and M(H₂O) = 18.015 g/mol. Step 2, moles. n(glycol) = 2220 / 62.068 = 35.77 mol and n(water) = 2000 / 18.015 = 111.02 mol. Step 3, total. 35.77 + 111.02 = 146.79 mol. Step 4, mole fractions. x(glycol) = 35.77 / 146.79 = 0.244 and x(water) = 111.02 / 146.79 = 0.756. The textbook answer is 0.244. By mass the mixture is 52.6 % glycol, so a nearly 50:50 mixture by mass has fewer than one glycol molecule in four, because each glycol molecule is about 3.4 times heavier than a water molecule. The same example gives a molality of 35.77 mol / 2.00 kg = 17.9 mol/kg, which you can confirm with the Molality Calculator.

Mass fraction and mole fraction

For two components A and B, taking 100 g of mixture (for the mass basis) or 1 mol (for the mole basis) gives:

xA = (wA/MA) / (wA/MA + wB/MB) wA = xA·MA / (xA·MA + xB·MB)

For 50 wt % ethanol in water, 50 g of ethanol is 50 / 46.069 = 1.085 mol and 50 g of water is 50 / 18.015 = 2.775 mol, so x(ethanol) = 1.085 / 3.861 = 0.281; enter 50 g of C2H5OH and 50 g of H2O in the mole fraction calculator to see it. The lighter molecule always gains in the mole basis. The reference table below is handy for distillation problems, where equilibrium data are given in mole fractions but feeds are specified by mass; any row can be checked the same way with a 100 g basis.

Ethanol, wt %Ethanol, mole fraction xEthanol, mol %
100.04164.16
200.08918.91
300.143514.35
400.206820.68
500.281128.11
600.369736.97
700.477147.71
800.610061.00
900.778777.87
950.881488.14

Going the other way, an equimolar mixture (x = 0.5) of ethanol and water is 71.9 wt % ethanol (enter 1 mol of each). To convert a single binary value directly between wt %, mole fraction, molarity, molality or ppm, use the Concentration Converter, which owns those unit conversions.

Mole fraction in gas mixtures and partial pressure

For ideal gases, equal volumes at the same temperature and pressure contain equal numbers of molecules (Avogadro’s law), so the mole fraction of a gas equals its volume fraction. Dry air, for example, is about 78.08 % N₂, 20.95 % O₂, 0.93 % Ar and 0.04 % CO₂ by volume, which are also its mole percentages; by mass the same air is roughly 75.5 % N₂, 23.1 % O₂ and 1.3 % Ar, and the mole fraction calculator gives an average molar mass close to 28.97 g/mol. Dalton’s law then gives each partial pressure as pi = yi · P. To find partial pressures, total pressure or the pressure of a gas collected over water, use the Partial Pressure Calculator (Dalton’s Law). Once the mole fraction calculator has given you the liquid composition, Raoult’s law pi = xi · pi* links it to the vapor pressure of the pure component, which you can get from the Vapor Pressure Calculator.

Where the results of a mole fraction calculator are used

ApplicationWhy mole fractionRelation
Gas mixturesEqual to volume fraction for ideal gasespi = yi · P (Dalton)
Ideal solutionsVapor pressure depends on molecules at the surfacepi = xi · pi* (Raoult)
Colligative propertiesDepend on the number of solute particlesΔp = xsolute · p*solvent
Distillation (McCabe-Thiele)Equilibrium data in x and yy = αx / (1 + (α − 1)x)
Trace gasesppm by volume = y × 10⁶400 ppm CO₂ → y = 0.0004

Common mistakes when calculating mole fraction

Using masses directly. Mass fractions and mole fractions are different unless all molar masses are equal; always convert to moles first, as the mole fraction calculator does. Leaving out the solvent. The total in the denominator includes every component, the solvent too. Mixing up mole fraction and mole ratio. A ratio nA/nB of 0.32 is not a mole fraction of 0.32. Wrong formula. Element symbols are case-sensitive: Co is cobalt, CO is carbon monoxide. Rounding too early. Keep at least four significant figures in the moles; the mole fraction calculator keeps full precision until the end.

Related calculators

Get the molar mass and percent composition of any component with the Molar Mass Calculator, and convert grams to moles with the Mole Calculator. The Weight Percent Calculator handles mass, volume and mass/volume percent.

Frequently asked questions

How do you calculate mole fraction?

Convert the amount of every component to moles (mass divided by molar mass), add them to get the total, and divide the moles of each component by that total. The mole fractions of all components add up to 1.

What is the difference between mole fraction and mole percent?

Mole percent is the mole fraction multiplied by 100. A mole fraction of 0.244 is 24.4 mol %.

Does mole fraction have units?

No. It is a ratio of two amounts in moles, so the units cancel. That also makes it independent of temperature and pressure, unlike molarity.

How do I convert mass fraction to mole fraction?

Divide each mass fraction by its molar mass, then divide each result by the sum of the results. For 50 wt % ethanol in water: (0.5/46.069) / (0.5/46.069 + 0.5/18.015) = 0.281. In the mole fraction calculator, enter the mass fractions as grams of a 100 g sample; the concentration converter also converts a single wt % value directly.

Is the mole fraction of a gas the same as its volume fraction?

For ideal gases, yes: by Avogadro’s law equal volumes contain equal numbers of moles, so volume percent, mole percent and ppm by volume all describe the same composition.

Is this mole fraction calculator free?

Yes. It runs in your browser, needs no sign-up and does not store or send the values you enter.

Results are for study, homework and lab preparation; check important results against your own data, and follow your lab’s safety rules. Back to chemistry calculators or CalcSwiftly home.

Reviewed by: CalcSwiftly · Last reviewed: