Quick answer
Mole fraction X = n ÷ (n + n_others), the share of moles of one component in a mixture. 2 mol of a component among 8 mol total gives X = 0.2, or 20 mole percent.
Enter the moles of the component and the moles of everything. The calculator returns the mole fraction and mole percent.
Related tools: Mole Calculator: Convert between mass, moles and number of particles. Percent Yield Calculator: Percent yield of a reaction. Electron Configuration Calculator: Ground-state electron configuration of an element or monatomic ion, with noble-gas shorthand and unpaired electrons.
How to use the Mole Fraction Calculator
- Enter moles of the component (mol) (above 0).
- Enter moles of everything else (mol) (0 or more).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Moles of the component | A number, in mol | > 0 |
| Moles of everything else | A number, in mol | ≥ 0 |
Formula and method
Formula
X = n ÷ (n + n_others)
IEEE-754 double precision; shown to the decimals indicated.
Mole fractions of all components add to 1.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: Moles of the component = 2; Moles of everything else = 8.
| Result | Value |
|---|---|
| Mole fraction | 0.2 |
| Mole percent | 20% |
Example 2
Inputs: Moles of the component = 0.5; Moles of everything else = 0.5.
| Result | Value |
|---|---|
| Mole fraction | 0.5 |
| Mole percent | 50% |
Example 3
Inputs: Moles of the component = 1.2; Moles of everything else = 3.6.
| Result | Value |
|---|---|
| Mole fraction | 0.25 |
| Mole percent | 25% |
The first line is the headline result (mole fraction). Below it the mole Fraction Calculator lists mole percent, which describe the same case from other angles. IEEE-754 double precision; shown to the decimals indicated.
Properties
Mole fractions in a mixture add to 1. They are used in Raoult's law (vapour pressure of a solution) and Dalton's law of partial pressures. They need moles, not mass.
Converting from mass
Divide each mass by its molar mass first. A solution of 18 g water (1 mol) and 58.44 g NaCl (1 mol) has X = 0.5 for each. The component's moles can't exceed the total.
How the result changes with moles of the component
Holding every other input at the first worked example, this table changes only moles of the component. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.
| Moles of the component | Mole fraction | Mole percent |
|---|---|---|
| 1 | 0.111111 | 11.1111% |
| 2 | 0.2 | 20% |
| 4 | 0.333333 | 33.3333% |
| 8 | 0.5 | 50% |
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- Moles of the component: entering "0" shows "Moles of the component must be greater than 0." beside that field and no result.
- Moles of everything else: entering "-1" shows "Moles of everything else must be at least 0." beside that field and no result.
Choosing between the Mole Fraction Calculator and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Mole Calculator](/science/mole/) | start from and molar mass | Amount |
| [Percent Yield Calculator](/science/percent-yield/) | actual yield and theoretical yield | Percent yield |
| [Electron Configuration Calculator](/science/electron-configuration/) | element and charge | Electron configuration of H |
| [Dilution Calculator](/science/dilution-ratio/) | solve for | Final volume V₂ |
| [Molarity Calculator](/science/molarity-calculator/) | solute mass, molar mass and solution volume | Molarity |
Background: chemistry calculations
Most basic chemistry calculations chain three relations: moles n = mass ÷ molar mass, molarity M = n ÷ volume in litres, and dilution C₁V₁ = C₂V₂. Keep units consistent: grams with g/mol, litres with mol/L.
Molar masses come from standard atomic weights, which differ slightly between tables and with the isotopic make-up of a real sample.
Assumptions and limitations
- Needs moles, not mass
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for moles of the component and moles of everything else to confirm this.
Frequently asked questions
Do mole fractions have units?
No. A mole fraction is moles divided by moles, so it is a pure number between 0 and 1.
What is the sum of mole fractions?
The mole fractions of all components in a mixture add to exactly 1.
How is it used for gases?
It equals the volume fraction of an ideal gas.
What does the Mole Fraction Calculator calculate?
Mole fraction of one component in a mixture. It returns Mole fraction and Mole percent.
What formula does the Mole Fraction Calculator use?
X = n ÷ (n + n_others). Mole fractions of all components add to 1.
What do I need to enter in the mole Fraction Calculator?
You enter Moles of the component (mol) and Moles of everything else (mol).
How is the result rounded or limited?
IEEE-754 double precision; shown to the decimals indicated. Needs moles, not mass.
What is an example of a mole Fraction result?
With moles of the component 2 and moles of everything else 8, the mole fraction is 0.2.
Related calculators
- Mole Calculator — Convert between mass, moles and number of particles.
- Percent Yield Calculator — Percent yield of a reaction.
- Electron Configuration Calculator — Ground-state electron configuration of an element or monatomic ion, with noble-gas shorthand and unpaired electrons.
- Molarity Calculator — Concentration of a solution from solute mass, molar mass and volume.
- Average Atomic Mass Calculator — Weighted average of isotope masses.
Sources
- OpenStax, University Physics Volume 1 (Rice University): mechanics
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.