ForHosting KIT · Science

Mass fraction calculator

Find what share of a solution's mass is the dissolved substance: 25 g of salt in 100 g of solution is a mass fraction of 0.25, or 25 %, with 75 g of solvent making up the rest. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Mass of the solute
25
Total mass
100
You get
Solvent mass
75
Mass fraction
0.25
Mass percent
25

Mass fraction, also called weight fraction or mass percent composition, answers a simple laboratory question: what share of a solution’s mass is the dissolved substance? Chemists write the dimensionless mass fraction w as the solute mass divided by the total solution mass, then multiply by one hundred to report mass percent (often labelled w/w %). This capability computes that ratio deterministically from two numbers, returns solvent mass as the remainder, and rejects a zero total mass with a clear invalid input error so notebooks, LIMS hooks, and homework checkers never see Infinity.

Definition of mass fraction and how to prepare the two masses

Mass fraction of the solute is defined as w equals m of solute divided by m of total solution, where the total is solute plus solvent in the same mass unit. If you dissolve twenty-five grams of salt in enough water to make one hundred grams of solution, w is zero point two five and the mass percent is twenty-five percent. Both values must be finite; solute mass must be non-negative and total mass must be strictly positive.

Zero total mass is invalid input because division by zero is undefined for this product—the engine never invents an infinite fraction. Negative total mass is also rejected so the contract stays honest for laboratory work. The engine does not convert units for you: grams with grams, kilograms with kilograms, or any coherent pair is fine because the ratio is dimensionless.

Homework and lab report checks

Students enter solute and solution masses, verify mass percent against worked answers, and get a clear error when total mass is zero by mistake.

Formulation and recipe make-up

Process notebooks convert batch solute and total masses into weight fraction for labels, SPC charts, and solvent make-up calculations.

Is mass fraction the same as mass percent?

Mass percent is one hundred times the mass fraction. This calculator returns both so you can use the 0–1 ratio or the percentage form.

Is the mass fraction calculator free?

The browser tool runs free on your device.

Do solute and total need the same units?

Yes. Use any coherent mass unit for both fields (grams with grams, kilograms with kilograms). The ratio is dimensionless and does not convert units for you.

Should I enter the mass of the solvent or of the whole solution?

The whole solution: solute plus solvent. Dividing by the solvent alone gives a share that is too high. The calculator then works out the solvent mass for you as the total minus the solute.

Why can the mass fraction come out above 1?

Because a solute mass larger than the total is accepted on purpose and gives a fraction above one. A real solution can never do that, so such a result points to a data-entry mistake worth checking.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/chem/mass-fraction

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/chem/mass-fraction \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"solute_mass":25,"total_mass":100}'
{
  "solute_mass": 25,
  "total_mass": 100
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "chem.mass_fraction",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The free browser mass fraction calculator runs on your device with no account; the prepaid API charges $0.002 per successful item when servers and SDKs need the same stable contract.

Definition of mass fraction and how to prepare the two masses

Send the required fields solute_mass and total_mass as JSON numbers or numeric strings; aliases solute, m_solute, and mass_solute map to the numerator, while total, m_total, solution_mass, and mass_solution map to the denominator. Identical inputs always produce identical JSON because the path is pure arithmetic with no network, no random seed, and no wall clock. Classroom exercises, batch recipe checks, and quality-control sheets all use the same definition, so pinning expected mass_fraction and mass_percent in tests is safe across runs and languages.

Reading mass_fraction, mass_percent, solvent_mass, and error cases

Values whose absolute magnitude exceeds the published bound are rejected for isolate safety. Solute mass larger than total mass is mathematically allowed and yields w greater than one—useful for catching data-entry mistakes—so callers that require w between zero and one should validate that range in their own UI after reading the response. On success the response echoes solute_mass and total_mass, reports solvent_mass as total minus solute, and returns mass_fraction as the unitless ratio w together with mass_percent equal to one hundred times w. The formula field is always the string w equals m_solute over m_total, and method is always mass_fraction so downstream code can branch without sniffing shapes. Use mass_fraction when you need a 0–1 composition for further mole or concentration math; use mass_percent when labels, SDS-style summaries, or student answers expect a percentage; use solvent_mass when the next step is water or solvent make-up. Missing either required field, non-finite numbers, negative solute mass, non-positive total mass, and especially total_mass equal to zero all fail with invalid_input and are not charged after the engine rejects the request.

API usage, pricing, lab workflows, and practical limits

Call the free in-browser mass fraction calculator for homework checks, lecture demos, and quick batch math without installing a spreadsheet or chemistry CAS. Mass fraction is not mole fraction: converting requires molar masses, which this product intentionally leaves to a separate step so the search intent stays focused on w and mass percent. Send a JSON body with solute_mass and total_mass in matching mass units, optionally using the documented aliases if your form already says solution_mass. Use the prepaid API when a LIMS, tutoring platform, formulation notebook, or process-control pipeline needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. Pair this endpoint with density tools when you must move between mass and volume, or with dilution calculators when the next step is preparing a lower concentration from a stock. Authors shipping SDKs can map mass_percent directly into UI labels and mass_fraction into internal composition models—the same two numbers students write on paper when they compute weight percent by hand.

LIMS and tutoring APIs

Platforms call a stable prepaid endpoint for w and mass % instead of reimplementing division and percent formatting in every client language.

How do I calculate mass fraction with this tool?

Send JSON with solute_mass and total_mass in the same mass unit (for example 25 and 100). The response includes mass_fraction w and mass_percent = 100w.

What happens if total mass is zero?

The request fails with invalid_input. Mass fraction is defined as m_solute / m_total, so a zero denominator is rejected and not charged.

Read the full KIT documentation →