Skip to content
CalculatorAtlas

Mole Fraction Calculator

Tested

Mole fraction of one component in a mixture.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

mol
mol

Results

Enter your values and press Calculate. Results appear here.

  • • Result

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

  1. Enter moles of the component (mol) (above 0).
  2. Enter moles of everything else (mol) (0 or more).
  3. Press Calculate to see the result, and use Reset to start again.
Inputs of the Mole Fraction Calculator
InputWhat to enterAllowed values
Moles of the componentA number, in mol> 0
Moles of everything elseA 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.

Results of example 1
ResultValue
Mole fraction0.2
Mole percent20%

Example 2

Inputs: Moles of the component = 0.5; Moles of everything else = 0.5.

Results of example 2
ResultValue
Mole fraction0.5
Mole percent50%

Example 3

Inputs: Moles of the component = 1.2; Moles of everything else = 3.6.

Results of example 3
ResultValue
Mole fraction0.25
Mole percent25%

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.

How the result changes with moles of the component
Moles of the componentMole fractionMole percent
10.11111111.1111%
20.220%
40.33333333.3333%
80.550%

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.

Choosing between the Mole Fraction Calculator and similar calculators
CalculatorYou enterIt returns
[Mole Calculator](/science/mole/)start from and molar massAmount
[Percent Yield Calculator](/science/percent-yield/)actual yield and theoretical yieldPercent yield
[Electron Configuration Calculator](/science/electron-configuration/)element and chargeElectron configuration of H
[Dilution Calculator](/science/dilution-ratio/)solve forFinal volume V₂
[Molarity Calculator](/science/molarity-calculator/)solute mass, molar mass and solution volumeMolarity

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.

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.