Grams to particles calculator
18.015 grams of water at 18.015 g/mol is one mole, or 6.02214076 × 10²³ molecules. Enter a mass and a molar mass to get the moles and the particle count, written in scientific notation. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Mass
- 18.015
- Molar mass in g/mol
- 18.015
- Moles
- 1
- Avogadro number
- 602,214,076,000,000,000,000,000
- Particles
- 602,214,076,000,000,000,000,000
- Particles scientific
- 6.02214076e+23
When a problem gives you grams of a pure substance and its molar mass, the particle count is two textbook steps away: divide mass by molar mass to get moles, then multiply by Avogadro’s number.
What grams-to-particles means and which inputs you send
In stoichiometry the mole bridges laboratory mass to microscopic count. For a pure sample you first form amount of substance n equals mass m divided by molar mass M, both in consistent units—here grams and grams per mole—then scale by the Avogadro constant so N equals n times N_A, or equivalently N equals m over M times N_A.
Representative particles may be atoms of an element, molecules of a covalent compound, formula units of an ionic solid, or other agreed species; the arithmetic does not choose the label, only the numbers you supply. Search intent clusters around grams to particles calculator, convert mass to atoms, how many molecules in grams, mass and molar mass to particles, and formula units from grams. People want a numeric count they can check against a worksheet or feed into a pipeline—not only a reminder that Avogadro’s number exists.
Zero mass is valid and returns zero particles; fractional masses such as 0.25 grams are allowed for small samples. Molar mass must be strictly positive: zero or negative M is rejected because dividing by a non-positive molar mass is undefined in this product, and that failure is the hard guard the capacity promises.
Classroom use and how it differs from similar tools
Call the free in-browser grams to particles calculator for homework checks, lecture demos, and quick mass-to-count mental math without installing a chemistry package. Colligative particle-count tools answer a different search intent—they scale concentration by a van’t Hoff factor for freezing-point depression and boiling-point elevation, not mass over molar mass times Avogadro. Choose this landing when the question is literally how many atoms, molecules, or formula units are in a stated mass given a molar mass.
Source inputs follow the same retention rules as other KIT parse items, and the unit of billing is one item per successful conversion at the catalog floor.
What you can do with it
Homework and exam verification
Students and graders convert grams and molar mass to particle counts with the exact SI Avogadro constant, and get a clear error when molar mass is zero or negative.
FAQ
How do I convert grams to particles?
The response includes moles, particles equal to (m/M)×N_A, and a scientific-notation string.
Is the grams to particles calculator free?
The browser tool runs free on your device.
How is this different from moles to particles?
Moles to particles multiplies n by N_A when you already know moles. This calculator starts from mass and molar mass, computes n = m/M first, then applies Avogadro—matching the common grams-based homework path.
Does it matter whether my particles are atoms, molecules or formula units?
No, the arithmetic is the same. You decide what the count means: for water the particles are molecules, for copper metal they are atoms, and for an ionic solid they are formula units.
What happens if the molar mass is zero or negative?
The calculation is refused, because dividing by a molar mass that is not positive has no meaning. You get a clear message instead of an impossible particle count.
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/grams-to-particles \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mass":18.015,"molar_mass":18.015}'const res = await fetch("https://api.kit.forhosting.com/chem/grams-to-particles", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mass": 18.015,
"molar_mass": 18.015
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/chem/grams-to-particles",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mass": 18.015,
"molar_mass": 18.015
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/chem/grams-to-particles", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mass":18.015,"molar_mass":18.015}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mass":18.015,"molar_mass":18.015}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/chem/grams-to-particles", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"mass": 18.015,
"molar_mass": 18.015
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "chem.grams_to_particles",
"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.
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
This grams to particles calculator does exactly that with the exact SI Avogadro constant, rejects zero or negative molar mass with a clear invalid input error, and returns structured JSON—mass, molar mass, moles, particle count, and a scientific-notation string—that homework checkers, tutoring apps, and lightweight chemistry services can pin in tests without reimplementing floating-point edge cases.
What grams-to-particles means and which inputs you send
Send required fields mass and molar_mass as JSON numbers or numeric strings; aliases m, grams, and mass_g work for mass, and M, mm, molecular_weight, and mw work for molar mass so forms and scripts can match textbook variable names. Keep particle-type semantics outside the request: if the problem is water, particles are molecules; if copper metal, particles are atoms—the arithmetic path is identical.
How this calculator validates mass and M, multiplies by N_A, and shapes the response
Numeric strings that parse to finite numbers are accepted so web forms and CSV-style pipelines can pass values without an extra cast. There is no formula-to-molar-mass lookup and no unit conversion service beyond the g and g per mol contract—this is pure Avogadro scaling from mass and molar mass to particle count. Send a JSON body with required mass and molar_mass. Every numeric field must be finite: missing required values, empty strings, non-numeric text, NaN, and Infinity all fail immediately with invalid_input before any result is returned, and failed validation is not charged. After values are accepted the engine checks that mass is non-negative and that molar_mass is greater than zero; a zero or negative molar mass fails with a message that zero or negative molar mass is invalid_input so graders and APIs can detect the product error code and a stable match substring. When both fields pass, the engine computes moles as mass over molar_mass, multiplies by the exact SI Avogadro constant, checks that every intermediate and the product remain finite, and returns mass and molar_mass (echoed), moles, avogadro_number (the constant used), particles (the product as a JSON number), particles_scientific (the same value in fixed scientific notation for human-readable display and report tables), formula always equal to N equals open parenthesis m slash M close parenthesis times N_A, and method always equal to grams_to_particles so downstream code can branch without sniffing shapes. Magnitudes are capped at a published upper bound for Worker isolate safety while still covering every classroom exercise and typical lab-scale sample size.
API usage, pricing, classroom workflows, and how this differs from related tools
Use the prepaid API when a tutoring platform, coding-assessment sandbox, curriculum generator, lab notebook helper, or stoichiometry 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 a molar-mass tool when the problem starts from a chemical formula rather than a numeric M, and with moles-to-particles when you already have n and only need N equals n times N_A without a mass step. Results are fully deterministic across JavaScript engines for the same IEEE floating-point path, so authors shipping SDKs can map particles and particles_scientific directly into UI rows that show both a full double and a clean scientific string—the same shape students write when they apply Avogadro’s relationship by hand.
Integration use cases
Deterministic fixtures for chemistry tests
Pipelines that seed unit tests or interactive science demos can call a pure N=(m/M)×N_A oracle instead of reimplementing mass-to-moles-to-particles in every language.
Tutoring and curriculum generators
Lesson builders produce worked grams-to-particles examples with structured JSON for flashcards, step sheets, and auto-graded drills without embedding a chemistry stack.
Technical questions
What happens if molar mass is zero or negative?
The request fails with invalid_input. Molar mass must be strictly positive; zero or negative values are rejected and the request is not charged.
Which Avogadro number does this calculator use?
The exact SI value from the 2019 redefinition: N_A = 6.02214076×10^23 mol⁻¹, returned in the avogadro_number field.