Article — Mole Fraction Calculator
Mole Fraction Calculator: x_i = n_i / sum(n)
Mole fraction (x_i) is the ratio of moles of one component to the total moles in a mixture. It is dimensionless, runs from 0 to 1, and sums to exactly 1 across all components. For a binary mixture, x_A + x_B = 1, so knowing one fixes the other. Mole fraction is the natural composition unit for gases (Dalton's law) and ideal solutions (Raoult's law).
Unlike mass fraction or molarity, mole fraction does not change with temperature or pressure. It is a pure composition number, set the moment the mixture is prepared.
What mole fraction measures
Mole fraction counts particles. Whether the particles are atoms, molecules, or ions does not matter; what matters is the ratio of one count to the total count. A mixture of 2 mol N2 and 0.8 mol O2 has mole fractions x_N2 = 2 / 2.8 = 0.714 and x_O2 = 0.8 / 2.8 = 0.286. They sum to 1, as they must.
Because the unit is a pure ratio, no joules, no kelvins, no liters need to enter the calculation. The mole fraction of N2 in dry air is 0.7808 today and was 0.7808 a million years ago. Adding more nitrogen would change it, but heat, pressure, and altitude do not.
The mole fraction formula
x_i = n_i / sum(n) definitionx_A + x_B = 1 binary constraintmol % = 100 · x percent formP_i = x_i · P_total Dalton's lawP_i = x_i · P_i* Raoult's lawThe formula is one division. When starting from masses, first convert each mass to moles: n_i = m_i / M_i. The mole-fraction step is the same regardless of how the moles were obtained.
Mole fraction versus mass fraction
Mass fraction (w_i = m_i / total mass) and mole fraction give different numbers whenever the molar masses differ. A 50/50 mass blend of water (M = 18) and ethanol (M = 46) is mostly water on a molar basis: x_water = 0.72, x_ethanol = 0.28. The lighter molecule contributes more moles per unit mass, so it wins the mole-fraction count.
| Mixture | Mass fraction | Mole fraction |
|---|---|---|
| 50/50 water + ethanol | 0.50 each | 0.72 water / 0.28 ethanol |
| 50/50 H2 + O2 (gas) | 0.50 each | 0.94 H2 / 0.06 O2 |
| 50/50 NaCl + KCl | 0.50 each | 0.56 NaCl / 0.44 KCl |
The 21% oxygen "by volume" reported for Earth's atmosphere is actually a mole fraction. For ideal gases, mole fraction equals volume fraction because equal moles occupy equal volumes at the same T and P (Avogadro's law). For liquids and solids the equality breaks down: molar volumes differ widely.
Mole fraction and Dalton's law
Dalton's law of partial pressures: in an ideal gas mixture, the partial pressure of each component is its mole fraction times the total pressure. P_i = x_i · P_total. At sea level with total pressure 1 atm, oxygen contributes P_O2 = 0.21 atm; nitrogen contributes 0.78 atm; carbon dioxide contributes 0.00042 atm.
This is the basis of every gas-mixture problem. Anesthesia, scuba diving (nitrox blends), industrial gas welding, and atmospheric chemistry all hinge on partial pressures, which start from mole fractions.
Mole fraction and Raoult's law
Raoult's law: in an ideal solution, the vapor pressure of each component above the liquid is its mole fraction in the liquid times the pure-component vapor pressure. P_i = x_i · P_i*. A solute lowers the vapor pressure of the solvent by reducing the mole fraction of solvent below 1.
Raoult's law is the basis of fractional distillation: vapor enriches in the more volatile component (higher P_i*) at each stage, while liquid enriches in the less volatile one. Crude-oil refining columns and ethanol stills both rely on this mole-fraction relationship.
Common mole fractions in nature
- N2 in dry air: x = 0.7808
- O2 in dry air: x = 0.2095
- Ar in dry air: x = 0.00934
- CO2 in dry air (2024): x = 0.000421 (~421 ppm)
- Water in seawater (1.1 m salt): x = 0.980
- Hemoglobin O2 saturation (arterial): x = 0.98 of binding sites occupied
- Ethanol in 96-proof spirits: x = 0.20 (about 48 vol%)
Where mole fraction matters
Atmospheric science. All gas-concentration measurements in climate science (CO2 at 421 ppm, methane at 1.9 ppm) are mole fractions. The "ppm" stands for parts per million of moles of gas, not parts of mass. A doubling of atmospheric CO2 mole fraction from preindustrial 280 ppm to a projected 560 ppm is the headline metric in every IPCC report.
Petroleum refining. A crude distillation column has dozens of stages; at each one, the vapor enriches in lighter hydrocarbons by Raoult's law. The mole-fraction profile from top (light naphtha and gasoline) to bottom (heavy residue and asphalt) is the design output of the entire refinery. Process engineers track mole fractions of fifty or more distinct hydrocarbons through every tray.
Biophysics. Oxygen binding to hemoglobin is described by mole fractions of bound versus unbound binding sites. Cooperativity (the Hill curve) emerges from these mole-fraction relationships. The classic sigmoidal saturation curve plots fractional saturation (a mole-fraction) of bound oxygen against partial pressure (a mole-fraction times total pressure). Two mole-fraction quantities, one plot, the entire physiology of respiration.
Stable isotope geochemistry. The ratio of oxygen-18 to oxygen-16 in seawater, ice cores, and limestone is a mole fraction. Paleoclimatologists measure these ratios on samples millions of years old to reconstruct ancient temperatures. The standard delta notation expresses small deviations from a reference mole fraction.
Mole fraction mistakes
For ideal gases, volume fraction equals mole fraction because equal moles take equal volumes at the same T and P. For liquids and solids, they are not equal: 50 mL of ethanol in 50 mL of water has volume fraction 0.5 but mole fraction only 0.28 for ethanol. The molar volumes are different.
Other regular slips: confusing mass percent with mole percent (especially in alcohol and acid concentrations), forgetting to divide by molar mass when starting from grams, treating mole fraction as concentration in mol/L (it is dimensionless), and assuming non-ideal solutions still follow Raoult's law (they don't).
For dilute solutions where one component dominates (say, x_solvent > 0.99), mole fraction of the solute is essentially equal to its molality times the solvent's molar mass divided by 1000. For water as solvent, x_solute approximately equals m / 55.5, since 1 kg of water is 55.5 mol.