---
slug: mole-fraction-calculator
title: "Mole Fraction Calculator"
category: scientific
updated: 2026-11-17
canonical: https://calcseed.com/c/scientific/mole-fraction-calculator/
html: /c/scientific/mole-fraction-calculator/
---

# Mole Fraction Calculator

Calculate the mole fraction of each component in a two-component mixture from their amounts in moles. Free and instant.

## Quick answer

**Quick answer:** with the default inputs (1 mol, 3 mol), the mole fraction a is **0.25**. At these inputs: total moles = **4**, mole fraction B = **0.75**. Change any input to update the result.

## Default calculation

Values computed by this calculator at exactly the default inputs listed below.

### Inputs (defaults)

| Input | Value | Unit |
| --- | --- | --- |
| Moles of A | 1 | mol |
| Moles of B | 3 | mol |

### Outputs at these defaults

| Output | Value | Unit |
| --- | --- | --- |
| Mole fraction A | 0.25 |  |
| Total moles | 4 |  |
| Mole fraction B | 0.75 |  |
| Percent A | 25 |  |

## Formula

```text
X_A_ = n_A_ ÷ (n_A_ + n_B_)
```

## Inputs

| Variable | Type | Unit | Default |
| --- | --- | --- | --- |
| Moles of A | number | mol | 1 |
| Moles of B | number | mol | 3 |

## Outputs

| Result | Format |
| --- | --- |
| Mole fraction A | primary |
| Total moles | number |
| Mole fraction A | number |
| Mole fraction B | number |
| Percent A | percent |

## How it works

### What a mole fraction is

The mole fraction of a component is the number of moles of that substance divided by the total number of moles in the mixture. It is a pure ratio between 0 and 1, with no units, and this calculator returns it for both components along with the percentage of A.

The denominator is the total mole count, so the two fractions always add to exactly 1 and the two percentages always add to 100%. That is a built-in check on any answer: if X_A_ plus X_B_ is not 1, something was copied wrong.

Mole fraction is the natural unit for anything that counts particles rather than mass. Partial pressures in a gas mixture, vapour pressures over a solution, and equilibrium expressions all take mole fractions directly, which is why it appears constantly in physical chemistry even though it is rarely the number on a reagent bottle.

### Worked example at the defaults

The defaults are 1 mol of A and 3 mol of B, so the total is 4 mol. X_A_ = 1 ÷ 4 = **0.25** and X_B_ = 3 ÷ 4 = **0.75**. In percentage terms the mixture is 25.00% A by moles.

Double both amounts to 2 mol and 6 mol and nothing changes: 2 ÷ 8 is still 0.25. Mole fraction is an intensive property, so scaling a batch up or down leaves the composition alone. Halve only one component and the picture moves: 1 mol A with 1.5 mol B gives 0.40, a 60% relative jump in A.

The second component is not an afterthought. X_B_ = 1 − X_A_ in a two-component system, so calculating it separately is a consistency check rather than a second calculation. With three or more components the general form X_i_ = n_i_ ÷ &Sigma;n applies to each, and all of them still sum to 1.

### Mole fractions in real mixtures

| Mixture | n of A (mol) | n of B (mol) | X(A) | Percent A |
| --- | --- | --- | --- | --- |
| Dry air, O_2_ in N_2_ | 0.21 | 0.79 | 0.21 | 21% |
| Default mixture | 1 | 3 | 0.25 | 25% |
| Flue gas, CO_2_ in N_2_ | 1 | 9 | 0.10 | 10% |
| Ethanol in water, dilute | 2 | 8 | 0.20 | 20% |
| Brine, salt in water | 0.1 | 9.9 | 0.010 | 1.0% |
| Trace impurity in a solvent | 0.001 | 0.999 | 0.001 | 0.1% |

The brine row is the one to study. A solution described as 1% salt by moles has one sodium chloride unit for every hundred particles, which is about 3.2% by mass because salt weighs far more per mole than water. The next section works that difference through in full.

### Mole fraction versus mass fraction

Mass fraction divides grams by total grams, mole fraction divides moles by total moles, and the two agree only when every component has the same molar mass. Air is the classic demonstration: it is 21% oxygen by moles out of the bottle and 23% by mass, because oxygen (32 g/mol) is heavier than nitrogen (28 g/mol).

| Component | Moles | Molar mass | Mass | Mass fraction |
| --- | --- | --- | --- | --- |
| O_2_ | 0.21 mol | 32.00 g/mol | 6.72 g | 23.3% |
| N_2_ | 0.79 mol | 28.01 g/mol | 22.13 g | 76.7% |
| Total | 1.00 mol | — | 28.85 g | 100% |

Convert one way by multiplying each mole count by its molar mass, then dividing by the new total. Convert back by dividing each mass by its molar mass. The 21% and 23% pair is a 2.3 percentage point gap; for ethanol and water the gap is far wider, since 46 g/mol against 18 g/mol nearly inverts the ranking at low concentrations.

### Why chemistry uses this ratio

- Dalton&rsquo;s law: the partial pressure of each gas is its mole fraction times the total pressure, so 0.21 × 101.3 kPa gives 21.3 kPa of oxygen in air.
- Raoult&rsquo;s law: the vapour pressure of a component above an ideal solution is its mole fraction times its pure vapour pressure, so a 0.2 mole fraction ethanol solution at 20 &deg;C contributes 0.2 × 5.95 = 1.19 kPa.
- Equilibrium constants: K values for gas reactions are written in partial pressures, which collapse to mole fractions when the total pressure is fixed.
- Colligative properties: boiling point elevation and freezing point depression depend on the mole fraction of solute, not its mass.
- Material balances: reaction stoichiometry is already in moles, so a mole-fraction composition feeds straight into the next calculation with no conversion.

### Where the arithmetic goes wrong

- Entering grams and calling them moles, which produces a fraction of the right shape and the wrong value by the ratio of molar masses.
- Forgetting to total all components: with three substances, dividing by the sum of two gives a fraction that does not close to 1.
- Reversing the components when reporting, so 0.25 becomes the fraction of the major component rather than the minor one.
- Rounding intermediate fractions to two decimals before computing partial pressures, which can shift a 21.3 kPa result by 0.5 kPa.
- Assuming a mole fraction equals a volume fraction in a liquid, where partial molar volumes are not additive.

#### When the mixture is not ideal

Raoult&rsquo;s law and Dalton&rsquo;s law both assume the components behave independently. Ethanol and water do not: a 0.2 mole fraction ethanol solution has a total vapour pressure of about 3.1 kPa against an ideal prediction of 3.06 kPa, close enough, but the same mixture at 0.5 deviates by more than 10% because the two liquids attract each other. For engineering work the mole fraction is still the input, but it feeds an activity coefficient before it becomes a pressure.

#### Mole percent is the same number times 100

Analytical reports often quote mole percent, written mol%. The default 0.25 is 25.00 mol%, and a gas certificate saying 2 mol% CO_2_ means X = 0.02. Watch for the difference between mol% and vol%, which are interchangeable for ideal gases and not for liquids.

## FAQ

### What is a mole fraction?

The moles of one component divided by the total moles in the mixture. With 1 mol of A and 3 mol of B it is 1 ÷ 4 = 0.25, and the two fractions sum to 1.

### Is mole fraction the same as mass fraction?

No. Mole fraction counts particles, mass fraction weighs them. Air is 21% oxygen by moles but 23.3% by mass, because O_2_ at 32 g/mol is heavier than N_2_ at 28 g/mol.

### How is mole fraction used?

It scales partial pressures by Dalton&rsquo;s law and vapour pressures by Raoult&rsquo;s law, and it appears in equilibrium constants and colligative property formulas.

### Do mole fractions always add to 1?

Yes, by definition, since every component is divided by the same total. If yours sum to 0.98, a component or a mole count has been left out.

### What is the partial pressure of oxygen in air?

About 21.3 kPa at sea level, from 0.21 × 101.3 kPa. Double the total pressure to 2 atm and the same 0.21 mole fraction gives 42.5 kPa.

### How do I convert mole fraction to molarity?

Multiply by the total moles and divide by the volume in litres. A 0.25 mole fraction in 4 mol of mixture is 1 mol of A, which in 2 L is 0.5 M.

### Does doubling the amounts change the fraction?

No. 1 mol and 3 mol give 0.25, and 2 mol and 6 mol also give 0.25, because the ratio is unchanged by scale.

### What is 2 mol% in mole fraction?

0.02. Multiply a mole fraction by 100 for mol%, so 0.25 is 25 mol% and 0.001 is 0.1 mol%.

### How do I find the mole fraction from a mass percent?

Divide each mass by its molar mass to get moles, then apply the ratio. A 50/50 mixture by mass of ethanol (46) and water (18) is 1.087 and 2.778 mol, giving X_ethanol_ = 0.281, not 0.5.

## Method and sources

Methodology: Physical constants follow CODATA 2022 recommended values, and formulas follow standard physics definitions.

Last updated: 2026-11-17.
- Mole fraction definition: Xᵢ = nᵢ / Σn.
