Mass percent calculator
Get the weight-per-weight concentration printed on labels: 25 g of solute in 100 g of solution is 25 % (w/w), and a 5 % saline means 5 g of salt in every 100 g of solution, not in 100 mL of water. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Mass of the solute
- 25
- Total mass
- 100
- Mass percent
- 25 % (w/w)
- Mass fraction
- 0.25
A mass percent calculator turns two laboratory masses into the standard weight-per-weight concentration used on labels, homework, and quality-control sheets. Enter the mass of the solute and the total mass of the solution; the tool returns mass percent equals solute mass divided by total mass times one hundred, plus the unitless mass fraction, a readable formula, and step-by-step substitution so you can check the arithmetic by hand.
What mass percent means for solutions
Mass percent, often written mass % or % (w/w), is the fraction of a solution’s mass that comes from the solute, expressed on a percentage scale. The defining formula is mass percent equals mass of solute divided by mass of solution times one hundred. The denominator is the total solution mass—solute plus solvent—not solvent alone, which is a common homework trap.
Because both numerator and denominator use the same mass unit, grams cancel with grams and kilograms cancel with kilograms; you never mix milliliters of solvent with grams of solute in this definition. A five percent saline solution therefore means five grams of salt in every one hundred grams of solution, which is not the same as five grams dissolved in one hundred milliliters of water unless density happens to make those masses equal.
Mass fraction is the same ratio without the factor of one hundred, so a mass percent of twenty-five corresponds to a mass fraction of zero point two five. Classroom problems, pharmacopeia tables, and food-label “percent by weight” statements all rely on this definition. This calculator implements that closed formula only: it does not convert volume percent, mole percent, molarity, or molality, and it does not look up densities.
When total mass is zero or non-positive the ratio is undefined, so the tool rejects the input rather than inventing a concentration for an empty or inverted mixture.
Practical tips, limits, and related searches
Keep both masses in the same unit before you call the tool; converting kilograms of solution and grams of solute yourself is outside the scope of this calculator and will produce a wrong percentage if left inconsistent. Prefer sending numbers rather than pre-formatted strings when you control the client; string numbers are accepted only when they match a strict finite numeric pattern.
When solute exceeds total mass—for instance a transcription error that put solvent mass in the wrong field—the tool still returns a percentage above one hundred with an explicit note instead of clamping, so automated tests can catch data-entry bugs. This landing targets people searching for a mass percent calculator, mass percentage concentration, or w/w solution calculator online; it is not a molarity tool, not a volume-percent mixer, and not a density converter.
Prefer this capability when you already have both masses and only need the weight-percent figure; if your source is a word problem with volumes, convert to mass first.
What you can do with it
Homework checks for % (w/w) solutions
Students enter solute and solution masses from textbook problems and compare hand-written mass percent and mass fraction against a deterministic result before submitting.
Lab batch ticket verification
Technicians verify that a weighed formulation matches the target mass percent on the batch record without opening a spreadsheet for each check.
FAQ
What is mass percent concentration?
Mass percent (w/w) is (mass of solute ÷ mass of solution) × 100. Both masses must use the same unit. The related mass fraction is the same ratio without multiplying by 100.
What happens when total mass is zero?
Mass percent is undefined when the denominator is zero.
Can mass percent be greater than 100%?
Yes, if solute mass exceeds total solution mass (usually a data-entry error).
Is this the same as volume percent or molarity?
No. Mass percent uses masses only. Volume percent uses volumes; molarity uses moles per liter. Convert units yourself before calling if your data is not already mass-based.
Is the mass percent calculator free?
The browser tool is free and runs locally.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/chem/mass-percent \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"solute_mass":25,"total_mass":100}'const res = await fetch("https://api.kit.forhosting.com/chem/mass-percent", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"solute_mass": 25,
"total_mass": 100
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/chem/mass-percent",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"solute_mass": 25,
"total_mass": 100
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/chem/mass-percent", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"solute_mass":25,"total_mass":100}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"solute_mass":25,"total_mass":100}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/chem/mass-percent", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"solute_mass": 25,
"total_mass": 100
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "chem.mass_percent",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_abs | 1000000000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
When total mass is zero the percentage is undefined, so the API returns a clear invalid_input error instead of Infinity or a silent NaN.
How to call the API and what comes back
Solute mass must be non-negative; total mass must be strictly positive—values at or below one times ten to the minus fifteen, or any non-positive total, are treated as zero and rejected. If solute mass exceeds total mass the percentage can exceed one hundred and the message notes that explicitly so bad bookkeeping is visible. Send a JSON body with two required finite numbers: solute_mass (aliases mass_solute, m_solute, solute, grams_solute) and total_mass (aliases mass_total, solution_mass, m_total, mass_solution). Absolute values must stay within the published limit of one trillion so intermediate ratios remain finite in IEEE double precision on the Worker and in the browser. On success the response echoes rounded solute_mass and total_mass, sets mass_percent to the rounded percentage, mass_fraction to the unitless ratio solute over total, unit to the string percent w/w, formula to mass percent equals m_solute over m_total times one hundred, message to a short English summary, and steps to an ordered array of substitution lines. Failed validation—missing fields, non-finite numbers, values outside absolute limits, negative solute, or zero total mass—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and related searches
For teaching, pair examples: twenty-five grams of solute in one hundred grams of solution yields twenty-five percent; ten grams in two hundred grams yields five percent; and total mass zero demonstrates the hard invalid_input path that protects division by zero. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately set total mass to zero. Round-trip checks are easy: recompute solute divided by total times one hundred by hand and confirm it equals the published mass_percent within the same twelve-decimal rounding, and confirm that mass_fraction times one hundred reproduces mass_percent.
Integration use cases
Unit tests for formulation software
Generate known-good percentages plus deliberate zero-total-mass rejections for coding kata and API contract tests.