molecalculator

Solutions & Concentration

Mass to Mole Fraction Calculator in Grams

Calculator No. 02-0099 · Updated · Formula and assumptions shown below

Component 1 mole fraction 0.2649 fraction
Component 2 mole fraction
0.7351 fraction
Result, rounded to 4 decimal places
Component 1 mole percent
26.49 %
= 100 × Component 1 mole fraction
Component 2 mole percent
73.51 %
= 100 × Component 2 mole fraction
You enter
Component 1 mass (g), Component 1 molar mass (g/mol), Component 2 mass (g), Component 2 molar mass (g/mol)
You get
Component 1 mole fraction (fraction), Component 2 mole fraction (fraction), Component 1 mole percent (%), Component 2 mole percent (%)
Rounding
4 dp · 2 dp

For study and lab planning. The result follows from the numbers you enter and the formula shown. Check it against your method before you weigh, mix or dilute anything, follow the safety data sheet and your supervisor, and do not use it for clinical, dosing or medication work.

A mass-to-mole-fraction calculator converts each component’s mass in grams to moles, then reports each component’s mole fraction in the mixture. Enter the mass and molar mass for every component; the results are dimensionless fractions that add to 1, or to 100% when expressed as percentages.

Formula

For each component, first calculate amount of substance as moles = mass ÷ molar mass. Then calculate its mole fraction by dividing those moles by the total moles in the mixture:

ni = mi / Mi
xi = ni / Σnj

Here, n is amount in mol, m is mass in g, and M is molar mass in g/mol. The sum in the denominator includes every component being counted. For two components, x1 = (m1/M1) ÷ [(m1/M1) + (m2/M2)]. Mole percent is x × 100. Grams cancel against grams per mole, leaving moles; dividing by total moles leaves a unitless fraction.

Worked Example

Use the calculator’s defaults: 10 g of water, with molar mass 18.015 g/mol, and 90 g of sodium chloride, with molar mass 58.44 g/mol. These are the masses and molar masses entered in the block.

  1. Water amount: n1 = 10 g ÷ 18.015 g/mol = 0.55509 mol.
  2. Sodium chloride amount: n2 = 90 g ÷ 58.44 g/mol = 1.5400 mol.
  3. Total amount: ntotal = 0.55509 mol + 1.5400 mol = 2.0951 mol.
  4. Water mole fraction: x1 = 0.55509 ÷ 2.0951 = 0.2649 (4 decimal places).
  5. Sodium chloride mole fraction: x2 = 1.5400 ÷ 2.0951 = 0.7351 (4 decimal places).
  6. As percentages, these are 26.49% and 73.51%, respectively.

The two displayed fractions sum to 1.0000. The underlying values may differ slightly from the displayed total because each output is rounded independently.

Assumptions

  • The mixture contains exactly the two components entered; include additional substances in the total if they are part of the composition.
  • Each mass is the mass of that component, and each molar mass matches its chemical formula and composition.
  • The calculation treats each listed substance as a component. It does not model chemical reactions, dissociation, hydration, or changing composition.

What Mole Fraction Means

Mole fraction describes the share of the total number of moles contributed by one component. A fraction of 0.25 means one quarter of the counted moles belong to that component—not that it makes up one quarter of the mixture’s mass or volume. Mole fractions are useful in mixture composition, gas mixtures, and solution calculations because they are based on particle amounts rather than component weights.

Mass fraction answers a different question: what share of total mass belongs to a component? In the example, water is 10 g out of 100 g, so its mass fraction is 0.10, or 10%. Its mole fraction is 0.2649 because a gram of water represents more moles than a gram of sodium chloride. Always check whether a problem requests mass fraction, mole fraction, mass percent, or mole percent.

How to Use the Calculator

  • Choose the components to include and find each compound’s molar mass in g/mol from its formula and appropriate atomic weights.
  • Enter the mass of each component in grams. Convert other mass units first; for example, 1 kg = 1000 g.
  • Enter each corresponding molar mass. Do not enter the mixture’s total molar mass in place of a component value.
  • Read the mole fractions and, if helpful, the percentage outputs. For a mixture with more than two components, calculate each amount in moles and divide each by the sum of all component amounts.

Molar mass is calculated from a chemical formula by adding the atomic masses of all atoms in that formula. For example, water contains two hydrogen atoms and one oxygen atom, giving approximately 2(1.008) + 15.999 = 18.015 g/mol. For salts and other compounds, use the formula as written and account for waters of hydration if they are present.

Common Errors and Limits

The most frequent mistake is dividing a mass by another mass rather than by molar mass. The conversion to moles requires units of g divided by g/mol. Another common error is using a molar mass for the wrong formula—for example, confusing an anhydrous compound with a hydrate—or mixing milligrams with grams without converting units.

Include every relevant component in the denominator. If a mixture contains three substances, calculating a component’s fraction using only two of them overstates its share. Fractions for all components should total 1 before rounding; percentages should total 100%. A small discrepancy in displayed totals is usually rounding, while a substantial discrepancy suggests a missing component or incorrect input.

This calculator is a composition calculation, not a prediction of solution behavior. It does not account for reactions, phase changes, non-ideal interactions, or whether a compound separates into ions. If a question defines mole fraction on a particular chemical basis—such as ions rather than formula units—count the species specified by that question. For bench work, follow your lab method, the safety data sheet (SDS) and your supervisor.

Frequently Asked Questions

Can I calculate mole fraction from grams?
Yes. Convert each component’s grams to moles using its molar mass, add the component moles, then divide each component’s moles by that total.

Does mole fraction have a unit?
No. It is a ratio of moles to total moles, so the units cancel. It is usually written as a decimal from 0 to 1 or multiplied by 100 and written as a percentage.

Is mole fraction the same as mass fraction?
No. Mass fraction compares a component’s mass with total mass. Mole fraction compares its amount in moles with the total amount in moles. They generally differ when components have different molar masses.

How do I calculate mole fraction for more than two substances?
For every component, divide its mass by its own molar mass to get moles. Add all those mole amounts, then divide each individual amount by the sum.

Why don’t my mole fractions add exactly to 1?
Rounded outputs may not sum to exactly 1. Check with more digits; if the difference remains large, verify the molar masses, units, and whether every component was included.

Related

Formula used
in m1 | Component 1 mass | g | 10 | 0
in mm1 | Component 1 molar mass | g/mol | 18.015 | 0
in m2 | Component 2 mass | g | 90 | 0
in mm2 | Component 2 molar mass | g/mol | 58.44 | 0
out x1 | Component 1 mole fraction | fraction | (m1 / mm1) / ((m1 / mm1) + (m2 / mm2)) | 4
out x2 | Component 2 mole fraction | fraction | (m2 / mm2) / ((m1 / mm1) + (m2 / mm2)) | 4
out p1 | Component 1 mole percent | % | 100 * x1 | 2
out p2 | Component 2 mole percent | % | 100 * x2 | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.

More in this section

The whole Solutions & Concentration section →