Solve Xi = ni ÷ ntotal to find the mole fraction of each component in a mixture. Enter moles directly, convert component masses to moles first, or view the results as mole percent.
Components
Result
—
Enter moles for at least 2 components to compute mole fractions.
Components
Result
—
Enter a mass and molar mass for at least 2 components to compute mole fractions.
Components
Result
—
Enter moles for at least 2 components to compute mole percent.
4 min read3 steps6 terms3 examples6 FAQsXi = ni / ntotal
Mole fraction (Xi) tells you what share of the total moles in a mixture belongs to one component.
📋
Walk-through
How to Use This Calculator
3 steps▸
1
List each component
Add a row for every substance in the mixture and give it a short name (A, B, NaCl, water — anything that helps you tell the rows apart). You need at least 2 components for a mole fraction to mean anything.
2
Enter moles or mass
On the Mole Fraction tab, type the number of moles for each component directly. If you only know the mass, switch to the From Masses tab and enter mass plus molar mass instead — the calculator converts each to moles for you (moles = mass ÷ molar mass).
3
Read the mole fraction and mole percent
The result card shows each component's mole fraction Xi (a decimal between 0 and 1) and, in the Mole Percent tab, the same value as a percentage. The fractions of every component always add up to 1 (100%).
⚡
Reference
Formula & Methodology
3 formulas▸
Mole fraction
Xi = ni / ntotal
The mole fraction of component i (Xi) is its moles (ni) divided by the total moles of every component in the mixture (ntotal = n1 + n2 + ... + nk). Mole fraction is dimensionless — it has no units — and every Xi in a mixture sums to exactly 1.
Mole percent
mole % = Xi × 100
Mole percent is simply the mole fraction expressed on a 0-100 scale instead of a 0-1 scale. It is common in gas mixtures and alloy compositions where percentages read more naturally than decimals.
Moles from mass
ni = massi / molar massi
When you only know how much of a substance you have by mass, convert it to moles first using its molar mass (grams per mole), then apply the mole fraction formula to the resulting moles.
📖
Glossary
Key Terms Explained
6 terms▸
Mole fraction ↗The ratio of one component's moles to the total moles in a mixture (Xi = ni/ntotal). It is a dimensionless number between 0 and 1, and every mole fraction in a mixture sums to 1.
Mole percent ↗A mole fraction expressed as a percentage instead of a decimal (Xi × 100). All mole percents in a mixture sum to 100%.
Moles ↗The SI unit for amount of substance (symbol mol). One mole contains Avogadro's number (about 6.022 × 10^23) of particles — atoms, molecules, or ions.
Mixture ↗A combination of two or more substances (components) that are physically combined but not chemically bonded together, such as a solution, an alloy, or a gas blend.
Component ↗One of the individual substances that make up a mixture. Each component has its own mole fraction, moles, and mass within the overall mixture.
Total moles ↗The sum of the moles of every component in the mixture (ntotal = n1 + n2 + ... + nk). This is the denominator used to compute each component's mole fraction.
👥
Scenarios
Real-World Examples
3 worked examples▸
🧪
Two-component mixture
2 mol of A mixed with 3 mol of B
Moles of A 2 molMoles of B 3 mol
Total moles = 2 + 3 = 5. X_A = 2/5 = 0.400 and X_B = 3/5 = 0.600. The two fractions add up to exactly 1, confirming the math checks out. Adding more of component B (say, raising it to 4 mol) would push X_B higher and X_A lower — the component with the larger share of moles always has the larger mole fraction.
🧂
Computing from mass
58.44 g of NaCl mixed with 36 g of water
NaCl mass / molar mass 58.44 g / 58.44 g/molWater mass / molar mass 36 g / 18 g/mol
NaCl: 58.44 g ÷ 58.44 g/mol = 1 mol. Water: 36 g ÷ 18 g/mol = 2 mol. Total = 3 mol, so X_NaCl = 1/3 = 0.333 and X_water = 2/3 = 0.667. Notice that mass fraction and mole fraction differ here — NaCl is about 62% of the mixture by mass but only 33% by moles, because its molar mass is much larger than water's.
📊
Mole percent conversion
Same 2 mol A : 3 mol B mixture, read as a percentage
X_A 0.400X_B 0.600
Multiply each mole fraction by 100: X_A = 40.0% and X_B = 60.0%. Mole percent and mole fraction describe the same composition — percent is just easier to read at a glance, which is why gas mixtures and alloy specs are often labeled in mole percent instead of decimal fractions.
🔗
Reference
Cite This Calculator
APA & MLA▸
Use either format to cite this calculator in a paper, report, or resource list.
Mole fraction (Xi) tells you what share of the total moles in a mixture belongs to one component. It's the concentration unit chemists reach for when working with gas mixtures, vapor pressure (Raoult's law), and colligative properties, because unlike molarity or mass percent, it doesn't depend on volume or temperature — only on the amount of substance present.
How the Mole Fraction Calculator works
▸
Each component's mole fraction is its own moles divided by the total moles of every component in the mixture: Xi = ni / ntotal. Because every component's moles are counted in that same total, the mole fractions of all components in a mixture always sum to exactly 1 (or 100% in mole-percent terms) — the calculator uses that sum as a built-in sanity check on every result.
If you only know how much of a substance you have by mass rather than by moles, the From Masses tab converts each mass to moles first using n = mass ÷ molar mass, then applies the same mole fraction formula to the derived moles.
Inputs and what they mean
▸
Each row represents one component of the mixture: a short name for your own reference, plus either its moles directly or its mass and molar mass (in g and g/mol respectively). You need at least two components — a mole fraction only means something relative to the rest of the mixture. The molar mass of a substance can be looked up on a periodic table or a Molar Mass calculator, and is typically expressed in grams per mole (g/mol).
The input that moves the result most is the relative size of one component's moles compared to the others — doubling a small component's moles noticeably shifts its own fraction upward and slightly lowers everyone else's, since all fractions must still sum to 1.
Limits and edge cases
▸
Mole fraction requires at least two components with non-negative moles and a total greater than zero — the calculator will show a prompt rather than a result if those conditions aren't met. Mole fraction should not be confused with mass fraction or volume fraction: a component can be the majority of a mixture by mass while still being a minority by moles (or vice versa) if its molar mass differs a lot from the other components, as shown in the salt-and-water example above. For reacting mixtures or systems with significant non-ideal behavior, mole fraction is still defined the same way, but activities (rather than raw mole fractions) are used in equilibrium and thermodynamic calculations — consult a chemistry reference for those more advanced cases.
❓
Questions
Frequently Asked Questions
6 questions▸
What is the formula for mole fraction?+
Mole fraction is Xi = ni / ntotal — the moles of one component divided by the total moles of every component in the mixture. It's a dimensionless number between 0 and 1.
Why do all the mole fractions add up to 1?+
Because every component's moles are counted in the same total (ntotal). If you add up ni/ntotal for every component, the numerators sum to exactly ntotal, so the whole sum reduces to ntotal/ntotal = 1. This calculator shows that sum as a check on every computed result.
How do I calculate mole fraction from masses instead of moles?+
First convert each component's mass to moles using its molar mass: moles = mass ÷ molar mass (in g/mol). Once you have moles for every component, apply the standard mole fraction formula. The From Masses tab does this conversion automatically.
What is mole percent?+
Mole percent is the mole fraction multiplied by 100, so it reads on a 0-100% scale instead of a 0-1 decimal scale. The two describe the exact same composition — mole percent is just often preferred for gas mixtures and alloy specifications.
How is mole fraction different from mass fraction?+
Mole fraction compares components by amount of substance (moles), while mass fraction compares them by weight (grams). The two only match when every component has the same molar mass — otherwise a substance can dominate a mixture by mass while being a minority by moles, or the reverse.
What units does mole fraction use?+
Mole fraction is dimensionless — moles divided by moles cancels out the units entirely. Mole percent is likewise unitless, just expressed as a percentage rather than a decimal.
📄
Save & share
Get a branded PDF of your results
Download a one-page PDF of your numbers instantly. Add your email to also get our occasional calculator tips — no spam, unsubscribe anytime. Privacy.