Mole Fraction Calculator
Add each component of your mixture with its moles to calculate individual mole fractions (χ). Sum of all fractions always equals 1.
Substance / Component
Moles (n)
Components
—
Total Moles
—
mol
Sum of χ
1.0000
Composition Bar
Mole Fractions
| # | Substance | Moles (nᵢ) | Mole Fraction (χᵢ) | Percent (%) |
|---|
Embed This Calculator
Copy the code and paste it into any webpage to embed this calculator.
WordPress users: add a Custom HTML block (not the Embed block) and paste the code there.
Free to use. A small "Powered by Blucalculator" credit is appreciated but not required.
How to use this calculator
The calculator works with a simple table of components. Each row is one substance in your mixture.
Substance / Component is just a label. Type whatever makes sense: N₂, oxygen, ethanol, “component A.” The name doesn’t affect the calculation at all.
Moles (n) is the amount of that substance in moles. Enter the actual mole quantity, not a percentage or a mass. If you’re starting from grams, divide mass by molar mass first to get moles, then enter that number here.
Click + Add component to add more rows. You can have as many components as you need. Click the × on any row to remove it.
When you click Calculate Mole Fractions, the calculator divides each component’s moles by the total moles across all components. The output shows the mole fraction (χ) for each substance, plus the total moles (n_total) used in the denominator.
Example: air-like mixture of N₂, O₂, and CO₂
Components entered:
- N₂: 3.5 mol
- O₂: 1.0 mol
- CO₂: 0.5 mol
n_total = 3.5 + 1.0 + 0.5 = 5.0 mol
χ(N₂) = 3.5 / 5.0 = 0.700 χ(O₂) = 1.0 / 5.0 = 0.200 χ(CO₂) = 0.5 / 5.0 = 0.100
Sum check: 0.700 + 0.200 + 0.100 = 1.000 ✓
The mole fractions must sum to exactly 1.000. If your result doesn’t, you’ve either missed a component or entered a value in the wrong units. Use the sum as your error check before taking the result anywhere else.
What problem this calculator solves
Doing this by hand isn’t hard for 2 components. But with 5 or 6, you’re adding a column of decimals, dividing each number by the same total, and hoping you didn’t mistype anything. That’s where errors creep in, and in chemistry or engineering, a wrong mole fraction feeds a wrong partial pressure, which feeds a wrong equilibrium calculation, and the mistake compounds.
The calculator also removes the cognitive overhead of tracking n_total separately. You add your components, it sums them automatically, and every fraction is computed against the correct denominator.
It’s also useful for quick sanity checks. You’ve done the calculation on paper; you plug it in here to confirm. Takes 20 seconds and catches the arithmetic errors that textbook problems are built around punishing.
The concept explained simply
Think of mole fraction as a vote tally. Each molecule gets one vote. The mole fraction of a component is the fraction of votes it received out of the total cast.
It doesn’t matter if the molecules are big or small, heavy or light. A single mole of water and a single mole of ethanol each contribute equally to the total count. That’s what makes mole fraction different from mass fraction, where heavier molecules dominate.
This matters a lot in thermodynamics. Gas pressure comes from the number of collisions with a container wall, which depends on how many molecules are present, not how heavy they are. Mole fraction maps directly onto that physical reality.
Mole fraction is a count-based concentration. It tells you how many particles out of every 100 (or every 1) belong to a given component. Temperature doesn't change it. Pressure doesn't change it. That stability is the whole point.
The formula explained
The core formula is simple. For any component i in a mixture:
Where:
χᵢ is the mole fraction of component i (the Greek letter chi, pronounced “ky”). nᵢ is the moles of that component. n_total is the sum of moles of every component in the mixture.
The result is always between 0 and 1. A pure substance has χ = 1. A trace component present at, say, 0.001 mol in a 100 mol mixture has χ = 0.00001. There’s no unit on the answer. It’s dimensionless.
The most common mistake: entering mass in grams instead of moles. If you put 18 g of water and 46 g of ethanol directly into the calculator, you’ll get the wrong answer. Divide by molar mass first. Water: 18 g / 18 g/mol = 1.0 mol. Ethanol: 46 g / 46 g/mol = 1.0 mol. Then enter 1.0 and 1.0.
Reference table: common molar masses for converting grams to moles
If you’re starting from a mass-based measurement, you’ll need to convert. Here are molar masses for substances that show up frequently in mole fraction problems.
| Substance | Formula | Molar mass (g/mol) |
|---|---|---|
| Water | H₂O | 18.015 |
| Oxygen gas | O₂ | 31.999 |
| Nitrogen gas | N₂ | 28.014 |
| Carbon dioxide | CO₂ | 44.010 |
| Ethanol | C₂H₅OH | 46.068 |
| Methane | CH₄ | 16.043 |
| Hydrogen gas | H₂ | 2.016 |
| Argon | Ar | 39.948 |
| Ammonia | NH₃ | 17.031 |
| Benzene | C₆H₆ | 78.112 |
To convert: moles = mass (g) / molar mass (g/mol).
Real-world examples
The Dalton’s Law problem
A gas cylinder contains 2.0 mol of helium, 3.0 mol of neon, and 5.0 mol of argon at a total pressure of 10 atm. Find the partial pressure of each gas.
Partial pressures using mole fractions
n_total = 2.0 + 3.0 + 5.0 = 10.0 mol
χ(He) = 2.0 / 10.0 = 0.200 χ(Ne) = 3.0 / 10.0 = 0.300 χ(Ar) = 5.0 / 10.0 = 0.500
Partial pressure = χ × P_total
P(He) = 0.200 × 10 atm = 2.0 atm P(Ne) = 0.300 × 10 atm = 3.0 atm P(Ar) = 0.500 × 10 atm = 5.0 atm
The Raoult’s Law scenario
A solution contains 1.0 mol of benzene and 4.0 mol of toluene. The vapor pressure of pure benzene is 75 mmHg and pure toluene is 22 mmHg at 20°C. What’s the total vapor pressure?
Vapor pressure via Raoult’s Law
n_total = 1.0 + 4.0 = 5.0 mol
χ(benzene) = 1.0 / 5.0 = 0.200 χ(toluene) = 4.0 / 5.0 = 0.800
P_total = χ(benzene) × P°(benzene) + χ(toluene) × P°(toluene) P_total = (0.200 × 75) + (0.800 × 22) P_total = 15.0 + 17.6 = 32.6 mmHg
The industrial gas blend
A natural gas supplier needs to verify that a pipeline blend contains 85% methane, 10% ethane, and 5% propane by mole. They sample 200 total moles. Do the actual measurements match spec?
Checking blend composition against spec
Measured: 168 mol CH₄, 21 mol C₂H₆, 11 mol C₃H₈
n_total = 168 + 21 + 11 = 200 mol
χ(CH₄) = 168 / 200 = 0.840 (spec: 0.850) — slightly off χ(C₂H₆) = 21 / 200 = 0.105 (spec: 0.100) — slightly high χ(C₃H₈) = 11 / 200 = 0.055 (spec: 0.050) — slightly high
The blend is outside spec on all three components. Investigation needed.
Common mistakes people make
Using mass percent instead of moles. A solution described as “30% ethanol by mass” does not have a mole fraction of 0.30. You have to convert. Take 100 g of solution as your basis: 30 g ethanol (30/46.07 = 0.651 mol) and 70 g water (70/18.015 = 3.886 mol). Now calculate χ. You get 0.651 / (0.651 + 3.886) = 0.143. Very different from 0.30.
Forgetting components. In a real air sample, you might track nitrogen and oxygen but forget argon (0.93% by volume). For most problems that’s fine. But in precision gas work, ignoring trace components shifts every mole fraction slightly. The calculator catches this because you can’t add more than 100% of the total.
Confusing mole fraction with mole percent. Mole percent is just mole fraction × 100. χ = 0.21 for oxygen is the same as saying 21 mol%. Both are correct, but don’t mix them in the same calculation.
Applying mole fraction to non-ideal mixtures without checking. Raoult’s Law assumes ideal behavior. Real solutions deviate, sometimes significantly. The mole fraction calculation itself is always exact; it’s the downstream formula (Raoult’s Law, Henry’s Law, etc.) that may introduce error for non-ideal systems.
Treating χ as volume fraction for gases. For ideal gases at the same temperature and pressure, mole fraction and volume fraction are equal. But if conditions differ between components, or if the gas is non-ideal, they diverge. Don’t assume they’re the same.
The mass-to-moles conversion is where most students lose points. Before entering anything into the calculator, confirm you’re working in moles. If the problem gives you grams, milligrams, or kilograms, divide by the molar mass first.
Hidden factors most people ignore
Temperature changes composition if there’s a phase change. If you heat a solution and some component evaporates, the liquid-phase mole fractions shift. The calculator gives you the composition of the phase you’ve defined. Make sure you’re clear on which phase you’re analyzing.
Ionic compounds dissociate in water. If you dissolve NaCl in water, it splits into Na⁺ and Cl⁻. In solution, you now have 3 species, not 2. Whether to treat NaCl as one component or two depends on what you’re calculating. For colligative properties, you count ions separately. For most other purposes, you count the formula units. The calculator doesn’t know which you need.
Solvent identity matters in dilute solutions. When mole fractions get very small (trace components in large solvents), tiny errors in the denominator barely matter. But when you’re near a 50/50 mix, a small error in any component’s moles shifts everything noticeably.
Mole fraction doesn’t tell you about interactions. Two components might have χ = 0.5 each, but if they react strongly with each other, the equilibrium composition will look nothing like what you started with. Mole fraction describes what you put in, not necessarily what exists at equilibrium.
Mole fraction is a description of what you've mixed, not a prediction of what will happen. The chemistry still depends on the substances involved.
What to do with the result
For Dalton’s Law: multiply each mole fraction by the total pressure. The result is the partial pressure of that component. This works for any ideal gas mixture.
For Raoult’s Law: multiply each liquid-phase mole fraction by the pure-component vapor pressure. Sum those products to get the total vapor pressure of the solution. This applies to ideal liquid mixtures, which in practice means chemically similar components (like benzene and toluene).
For checking a blend: compare your calculated mole fractions to the spec sheet. If the values disagree beyond your tolerance, there’s a composition error somewhere. Mole fractions make it easy to spot which component is off.
For converting to other concentration units: if you need mass fraction, multiply χᵢ by the molar mass of i, then divide by the sum of (χⱼ × Mⱼ) across all components. That gives you weight fraction without having to redo the whole problem from scratch.
For reporting: mole fractions are unitless, so they need no unit label. Just report the number and the substance. χ(O₂) = 0.21 is complete as written.
You’re good to proceed when all mole fractions sum to 1.000 (or within rounding error, like 0.999 or 1.001 for 3-decimal results). That’s your built-in check. If the sum is 1, the denominator was correct and the fractions are reliable.
Limitations and misconceptions
The mole fraction formula is mathematically exact for any mixture you define. The limitations come from what you feed it. If your mole quantities came from an imprecise measurement, the mole fractions inherit that imprecision. The calculator doesn’t know the uncertainty in your inputs.
Mole fraction is also a bulk property. It describes the average composition of a mixture, not the local composition at any point. In a poorly mixed system, the mole fraction at one location might differ significantly from the mole fraction elsewhere. The calculation assumes homogeneity.
A common misconception: people think mole fraction is only for gases. It’s for any mixture, including liquid solutions and even solid solutions (alloys, for instance). The formula is the same. The interpretation is the same. What changes is which downstream equations you use the result in.
The calculator also can’t tell you about activities or fugacities, which are what you actually need for non-ideal systems. For dilute solutions and ideal gases, mole fraction plugs directly into the thermodynamic equations. For concentrated solutions of dissimilar components, you’ll need activity coefficients on top of the mole fraction.
For seawater or electrolyte solutions, the “right” way to count moles depends on context. If you want the mole fraction of water (which is what matters for osmotic pressure), count all dissolved ions separately. Most general chemistry problems skip this nuance, but it matters in environmental and physical chemistry work.
The bottom line
Mole fraction is one of the cleaner ideas in chemistry. The formula has two steps: sum all the moles, then divide each component’s moles by that sum. The calculator just does those two steps quickly and without arithmetic errors.
What you get is a dimensionless number between 0 and 1, temperature-independent, that you can plug directly into Dalton’s Law, Raoult’s Law, or any other relationship that expects mole-based composition. The sum-to-1 constraint is your error check.
Convert grams to moles before you start. Count every component in your mixture. And if the fractions don’t sum to 1, something was missed or mistyped.
That’s the whole thing.
Frequently Asked Questions
What is mole fraction?
The mole fraction (χᵢ) of a component is the ratio of its moles to the total moles in the mixture: χᵢ = nᵢ / Σn. It is dimensionless and the sum of all mole fractions in any mixture is always exactly 1.
How is mole fraction used in gas mixtures?
For an ideal gas mixture, the partial pressure of component i equals its mole fraction times the total pressure: Pᵢ = χᵢ × P_total. This is Dalton's Law of Partial Pressures.
What is the difference between mole fraction and mass fraction?
Mole fraction uses number of moles; mass fraction uses mass. They differ unless all components have the same molar mass. To convert, divide each component's moles by its molar mass to get mass, then find the mass fraction.
Can mole fraction be greater than 1?
No. Since χᵢ = nᵢ / Σn and Σn ≥ nᵢ, the mole fraction is always between 0 and 1. A pure substance has χ = 1; the other components have χ = 0.
What is the mole fraction of oxygen in dry air?
Dry air is approximately: N₂ = 0.7808 (78.08%), O₂ = 0.2095 (20.95%), Ar = 0.0093 (0.93%), CO₂ = 0.0004 (0.04%). So the mole fraction of oxygen χ(O₂) ≈ 0.2095. This means oxygen exerts about 20.95% of the total atmospheric pressure.
How do I calculate partial pressure from mole fraction?
For an ideal gas mixture: Pᵢ = χᵢ × P_total (Dalton's Law). If total pressure is 1 atm (101,325 Pa) and χ(O₂) = 0.2095, then P(O₂) = 0.2095 × 101,325 = 21,228 Pa ≈ 0.21 atm. This is why scuba tanks at depth deliver higher partial pressures of oxygen.
How do I convert between mole fraction and molarity?
For a solution: Molarity (mol/L) = χ_solute × (density of solution in g/mL × 1000) / molar mass of solution. For dilute aqueous solutions, molarity ≈ χ_solute × 55.5 (since pure water is ~55.5 mol/L). This approximation is valid below ~0.1 M.
How do I convert mole fraction to mass fraction?
Mass fraction of component i = (χᵢ × Mᵢ) / Σ(χⱼ × Mⱼ), where M is molar mass. Example: equimolar mixture of H₂ (2 g/mol) and O₂ (32 g/mol), each χ = 0.5. Mass fraction of H₂ = (0.5 × 2) / ((0.5 × 2) + (0.5 × 32)) = 1/17 ≈ 0.059 (5.9%). Mass fraction of O₂ = 16/17 ≈ 94.1%.
What is Raoult's Law and how does mole fraction apply?
Raoult's Law states that for an ideal solution, the partial vapour pressure of a component equals its mole fraction in the liquid multiplied by its pure vapour pressure: Pᵢ = χᵢ × Pᵢ*. This is used in distillation design. A 50:50 ethanol-water mixture (by moles) would have χ(ethanol) ≈ 0.5, contributing 0.5 × 59 mmHg ≈ 29.5 mmHg of ethanol vapour at 20 °C.
How is mole fraction used in expressing concentration of solutions?
Mole fraction is useful when comparing concentrations across different solvents or at varying temperatures. Unlike molarity (mol/L), it does not depend on solution volume, which changes with temperature. It is commonly used in thermodynamics, phase diagrams, and colligative property calculations (boiling point elevation, freezing point depression).
Related Calculators
Molality Calculator
Calculate the molality of a solution — moles of solute per kilogram of solvent. Enter mass of solute, its molar mass, and mass of solvent.
Molarity Calculator
Calculate the molarity (molar concentration) of a solution — moles of solute per litre. Enter mass of solute, its molar mass, and volume of solution.
Mole Calculator
Calculate moles from mass and molar mass, number of atoms/molecules, or gas volume at STP. Three modes via the "Calculate From" selector.
Molar Mass Calculator
Calculate the molar mass of any chemical compound by entering its formula. Shows atomic mass breakdown for each element.
Grams to Moles Calculator
Convert grams of a substance to moles using molar mass. Supports any compound by entering its molar mass manually.
Atoms to Moles Calculator
Convert a number of atoms to moles using Avogadro's number (6.022 × 10²³). Supports scientific notation input.