Boneyard Tools

Mole Fraction Calculator

Work out the mole fraction of every substance in a mixture at once. Add a row for each component, type its amount in moles, and the calculator divides each amount by the running total to give a fraction between 0 and 1. It also shows the total moles, and the fractions always add up to exactly 1.

How to calculate mole fraction

  1. Name the first component and enter its moles in the Moles column.
  2. Click Add component to insert another row, then fill in its moles.
  3. Use the x button to remove any row you added by mistake.
  4. Read the mole fraction shown in bold next to each component.
  5. Check the Total moles line, then click Copy to save the results.

Examples

Two components

A = 2 mol, B = 3 mol
x(A) = 0.4, x(B) = 0.6, total moles = 5

Three components

Methane = 2 mol, Ethane = 5 mol, Propane = 3 mol
x(methane) = 0.2, x(ethane) = 0.5, x(propane) = 0.3, total moles = 10

Single component

X = 4 mol
x(X) = 1, total moles = 4

Frequently asked questions

What is mole fraction?

Mole fraction is the moles of one component divided by the total moles of everything in the mixture. It has no units and always lands between 0 and 1.

What is the mole fraction formula?

The mole fraction of component i is written x_i = n_i / n_total, where n_i is the moles of that component and n_total is the sum of the moles of all components.

Do the mole fractions always add up to 1?

Yes. Each fraction is one component's share of the same total, so summing the shares reconstructs the whole, which is 1. That property is a quick way to check your entries.

How do I convert a mass into moles first?

Divide each mass in grams by that substance's molar mass in grams per mole, then type the resulting moles into a row. Water at 18 grams per mole means 36 grams is 2 moles.

How is mole fraction different from mass percent?

Mole fraction counts particles through moles, while mass percent compares weights. The two only match when every component happens to share the same molar mass.

Can I enter more than two or three components?

Yes. Add as many rows as your mixture needs with the Add component button. The total updates as you go and each fraction is recalculated against the new total.

What happens if I leave a moles field blank or use zero?

Blank rows are skipped, so they do not affect the total. A value of zero or below is rejected and the tool shows a message asking for moles greater than zero.

Why do my fractions have so many decimals?

Fractions are rounded to nine decimal places, so amounts that do not divide evenly, such as 1 mole out of 3, show a long repeating decimal like 0.333333333.

Is anything I type uploaded?

No. The calculation runs locally in your browser, so component names and amounts never leave your device.

Learn more

Related tools