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
- Name the first component and enter its moles in the Moles column.
- Click Add component to insert another row, then fill in its moles.
- Use the x button to remove any row you added by mistake.
- Read the mole fraction shown in bold next to each component.
- 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
- Mole fraction versus molarity, molality and mass percent
How mole fraction relates to molarity, molality and mass percent, when each unit is the right choice, and how to move between them.
Related tools
Mole Calculator
Convert between moles, mass and particles. Enter mass and molar mass, or moles, or a particle count, and get the rest using Avogadro's number.
Molarity Calculator
Calculate molarity in mol per litre and solve for moles, volume or concentration. Find moles from mass and molar mass, then get the missing value.
Mass Percent Calculator
Calculate the mass percent of a solute by mass. Enter the solute mass plus the solvent mass or the total solution mass to get percent by mass instantly.
555 Timer Calculator
Calculate 555 timer astable frequency, period, high and low times and duty cycle from R1, R2 and the timing capacitor. Free oscillator design helper.
Absolute Humidity Calculator
Calculate absolute humidity in grams of water vapor per cubic meter from air temperature and relative humidity. Fast, free and works in your browser.
Allele Frequency Calculator
Find allele frequencies from genotype counts. Enter the number of AA, Aa and aa individuals to get the A and a allele frequencies and allele totals.