ForHosting KIT · Science

Element percent by mass calculator

32 g of an element in a compound of 98 g/mol is 32.65 % by mass: enter both masses and get the percentage, the mass fraction and the substitution written out step by step for checking by hand. 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
Element mass
32
Compound molar mass
98
You get
Mass percent
32.6530612245
Mass fraction
0.3265306122

An element percent by mass calculator turns the mass contribution of one element and the molar mass of its compound into the standard mass-percent composition figure used in homework, analytical chemistry, and formula checks. Enter the total mass of the element in one mole (or one formula unit) of the compound and the compound molar mass; the tool returns mass percent equals element mass divided by compound molar mass times one hundred, plus the unitless mass fraction, a readable formula, and step-by-step substitution so you can verify the arithmetic by hand.

What mass percent composition of an element means

Mass percent composition of an element in a pure compound is the fraction of the compound’s mass that comes from that element, expressed on a percentage scale. The defining formula is mass percent equals mass of the element in one mole of compound divided by the molar mass of the compound times one hundred. In a textbook problem you usually form the numerator as the number of atoms of the element in the formula times the atomic mass of that element, then divide by the molecular or formula weight.

Because both numerator and denominator use the same mass unit—grams of element versus grams per mole of compound when one mole is the reference—the ratio is dimensionless before you multiply by one hundred. A result of thirty-two percent oxygen means thirty-two grams of oxygen in every one hundred grams of that compound. 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.

This calculator implements only the closed ratio of the two masses you supply: it does not look up atomic weights, parse chemical formulas, or convert mole percent, volume percent, or solution w/w concentration. When compound molar mass is zero or non-positive the ratio is undefined, so the tool rejects the input rather than inventing a composition for a nonexistent formula weight.

Practical tips, limits, and related searches

Keep element mass and compound molar mass on the same unit basis before you call the tool; mixing kilograms of element contribution with grams-per-mole of formula weight 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 element mass exceeds molar mass—for instance a transcription error that put the wrong atomic total in the numerator—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 an element percent by mass calculator, percent composition by mass, or mass percent of an element in a compound; it is not a solution mass-percent (w/w) tool, not a mole-percent mixer, and not an atomic-mass lookup table.

Prefer this capability when you already have both masses and only need the elemental mass-percent figure; if your source is a raw formula, compute n times atomic mass and the molar mass first.

Homework checks for percent composition

Students enter element mass contribution and compound molar mass from textbook problems and compare hand-written mass percent and mass fraction against a deterministic result before submitting.

Empirical and molecular formula checks

Analysts verify that an element’s mass percent from lab data matches the theoretical composition of a proposed formula without opening a spreadsheet for each element.

What is mass percent composition of an element?

Mass percent of an element in a compound is (mass of the element in one mole of compound ÷ molar mass of the compound) × 100. Both quantities must use a consistent mass unit basis. The related mass fraction is the same ratio without multiplying by 100.

What happens when compound molar mass is zero?

Mass percent composition is undefined when the denominator is zero.

Can mass percent be greater than 100%?

Yes, if element mass exceeds compound molar mass (usually a data-entry error).

Is this the same as solution mass percent (w/w)?

No. Solution mass percent uses solute mass over total solution mass. This tool is for pure-compound elemental composition: element mass contribution over compound molar mass.

Is the element percent by mass calculator free?

The browser tool is free and runs locally.

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/percent-composition-element

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/percent-composition-element \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"element_mass":32,"compound_molar_mass":98}'
{
  "element_mass": 32,
  "compound_molar_mass": 98
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "chem.percent_composition_element",
  "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.

max_abs1000000000000
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.

When molar 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

Element mass must be non-negative; compound molar mass must be strictly positive—values at or below one times ten to the minus fifteen, or any non-positive molar mass, are treated as zero and rejected. If element mass exceeds compound molar 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: element_mass (aliases mass_element, element_total_mass, m_element, grams_element, element_mass_total) and compound_molar_mass (aliases molar_mass, molecular_weight, M, compound_mass, mw, molar_mass_compound). 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 element_mass and compound_molar_mass, sets mass_percent to the rounded percentage, mass_fraction to the unitless ratio element over molar mass, unit to the string percent by mass, formula to mass percent equals m_element over M_compound 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 element mass, or zero molar 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: thirty-two grams of oxygen contribution in ninety-eight grams per mole of sulfuric acid yields about thirty-two point six five percent; twelve grams of carbon in one hundred eighty grams per mole of glucose yields about six point six seven percent; and molar 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 molar mass to zero. Round-trip checks are easy: recompute element mass divided by compound molar mass 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.

Unit tests for stoichiometry software

Generate known-good elemental mass percentages plus deliberate zero-molar-mass rejections for coding kata and API contract tests.

Read the full KIT documentation →