Avogadro's law calculator
Predict a gas's new volume when only the amount of gas changes: 2 litres holding 1 mol become 6 litres at 3 mol, with temperature and pressure unchanged. Double the moles and the volume doubles. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- V1
- 2
- N1
- 1
- N2
- 3
- V2
- 6
- Ratio
- 3
- Law
- avogadro
- Conditions
- constant temperature and pressure
An Avogadro's law calculator turns initial volume and a change in amount of gas into the final volume you expect when temperature and pressure stay fixed. Ideal-gas classroom problems, process-scale estimates when only the mole count changes, and coding kata expected values all need that same V proportional to n rule without opening a full equation-of-state solver.
What Avogadro's law says about volume and moles
Avogadro's law states that equal volumes of ideal gases at the same temperature and pressure contain equal numbers of molecules, which rearranges to a simple proportionality: volume is directly proportional to the amount of substance when T and P are held constant. In symbols, V1 over n1 equals V2 over n2, so the final volume is V2 equals V1 multiplied by the ratio n2 over n1.
If you double the moles of gas in a piston held at fixed temperature and pressure, the volume doubles; if you remove half the moles, the volume halves. The law is the n-branch of the ideal-gas family that also includes Boyle (P-V at fixed n,T), Charles (V-T at fixed n,P), and Gay-Lussac (P-T at fixed n,V).
Teachers and automated graders care about the zero-n1 rejection as much as the happy path: a student who sets initial moles to zero has left the domain of the ratio, and inventing an infinite volume would hide that mistake. The check path recomputes the ratio and product with the same fixed twelve-decimal rounding used for published fields, so a successful response always ships with steps you can assert in tests or worksheets.
Volume units are caller-chosen and consistent—litres, cubic metres, or millilitres all work as long as V1 and V2 share the same unit—while n1 and n2 are always in moles.
Practical tips, limits, and related searches
Keep inputs inside the published absolute range so the product V1 times n2 over n1 cannot overflow into a non-finite final volume that the solver must reject. 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. Near-zero initial moles after floating cancellation are classified as zero and rejected so noise does not invent a huge volume.
Prefer this capability when temperature and pressure truly stay fixed and only the amount of gas changes; if P or T also moves, use an ideal or combined gas-law tool instead. Round-trip checks are easy: recompute V1 times n2 divided by n1 by hand and confirm it equals the published v2 within the same twelve-decimal rounding, and confirm that doubling n2 at fixed n1 doubles v2.
What you can do with it
Homework checks for V ∝ n problems
Students enter textbook V1, n1, and n2 and compare hand-written final volume and mole ratio against a deterministic result before submitting.
Lab scale-up at fixed T and P
Process notes estimate piston or balloon volume when more moles of gas are added without changing bath temperature or external pressure.
FAQ
What is Avogadro's law?
At constant temperature and pressure, the volume of an ideal gas is proportional to its amount in moles: V1/n1 = V2/n2, so V2 = V1·(n2/n1).
Do I need temperature or pressure as inputs?
No. Avogadro's law assumes T and P are constant; only V1, n1, and n2 are required.
Is this the same as Avogadro's number (N_A)?
No. Avogadro's number converts moles to particle counts. This calculator applies Avogadro's gas law for volume versus moles.
Is the Avogadro's law calculator free?
The browser tool is free and runs locally.
Which volume units can I use?
Any unit, as long as the initial and final volumes share it: litres, cubic metres or millilitres all work, and the answer comes back in the same unit as the initial volume. Amounts are always in moles.
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/avogadro-law \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"v1":2,"n1":1,"n2":3}'const res = await fetch("https://api.kit.forhosting.com/chem/avogadro-law", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"v1": 2,
"n1": 1,
"n2": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/chem/avogadro-law",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"v1": 2,
"n1": 1,
"n2": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/chem/avogadro-law", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"v1":2,"n1":1,"n2":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"v1":2,"n1":1,"n2":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/chem/avogadro-law", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"v1": 2,
"n1": 1,
"n2": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "chem.avogadro_law",
"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
Enter V1, n1, and n2; the tool returns V2 equals V1 times n2 over n1, the mole ratio, a clear formula string, and step-by-step substitution so homework checks, lab write-ups, and pipeline tests all see the same deterministic JSON. When initial moles are zero the ratio is undefined, so the API returns invalid_input instead of infinity or a silent nonsense volume.
How to call the API and what comes back
Initial volume v1 must be strictly positive; initial moles n1 must be strictly positive and non-zero—values whose absolute value is at or below one times ten to the minus fifteen are treated as zero and rejected; final moles n2 must be non-negative. Send a JSON body with three required finite numbers: v1 (aliases V1, volume1, initial_volume, v_initial), n1 (aliases N1, moles1, initial_moles, n_initial), and n2 (aliases N2, moles2, final_moles, n_final). Absolute values must stay within the published limit of one trillion so intermediate products remain finite in IEEE double precision on the Worker and in the browser. On success the response echoes rounded v1, n1, and n2, sets v2 to the computed final volume, ratio to n2 over n1, formula to the string V2 equals V1 times n2 over n1, law to avogadro, conditions to constant temperature and pressure, unit_volume and unit_moles to short unit hints, 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, non-positive volume, zero or negative initial moles, or negative final moles—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
When teaching, pair examples: V1 equals two litres with n1 equals one mole and n2 equals three moles yields V2 equals six litres; equal moles leave volume unchanged; and n1 equals zero demonstrates the hard invalid_input path that protects division by zero. This landing targets people searching for an Avogadro's law calculator, gas volume from moles, or V1 n1 V2 n2 online; it is not a full ideal-gas PV equals nRT solver, not a moles-to-atoms converter via Avogadro's number, and not a unit converter for volume. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately set n1 to zero.
Integration use cases
Unit tests for gas-law helpers
Generate known-good V2 cases plus deliberate n1-equals-zero rejections for coding kata expected values and CI fixtures.
Technical questions
What happens when initial moles n1 is zero?
The ratio is undefined. This tool returns invalid_input instead of computing an infinite or nonsensical volume.