ForHosting KIT · Science

Avogadro's law moles calculator

Find the moles of gas that match a new volume at fixed temperature and pressure: 1 mol in 2 litres corresponds to 2 mol in 4 litres. Enter both volumes and the starting moles, and the volume ratio is shown too. 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
Initial gas volume
2
Final gas volume
4
N1
1
You get
N2
2
Ratio V2 over V1
2
Precision
10

This Avogadro's law moles calculator finds the final amount of gas when volume changes at constant temperature and pressure. You supply the initial volume V1, the final volume V2, and the initial moles n1; the engine returns the final moles n2 from the classical proportion V1 over n1 equals V2 over n2, which rearranges to n2 equals n1 times V2 over V1. That identity is the gas-phase form of Avogadro's principle: equal volumes of ideal gas at the same T and P contain equal numbers of particles, so moles scale linearly with volume when those conditions hold. Worked checks include V1 equals two, V2 equals four, n1 equals one yielding n2 equals two, and V1 equals five, V2 equals two point five, n1 equals zero point eight yielding n2 equals zero point four. The path is pure finite arithmetic with no network calls, no sampling, and no date-dependent shortcuts.

What the moles calculation tells you

Avogadro's law states that, for an ideal gas held at constant temperature and pressure, volume is directly proportional to the amount of substance. In symbols V is proportional to n, or V1 divided by n1 equals V2 divided by n2 when you compare two states of the same gas under those fixed conditions. Solving for the unknown final moles gives the closed form n2 equals n1 times V2 over V1.

This calculator is dedicated to that single rearrange: it does not solve Boyle's law, Charles's law, Gay-Lussac's law, or the combined gas law, and it does not convert between pressure or temperature units because those quantities are assumed constant and therefore drop out of the proportion.

Where Avogadro mole changes fit in study, labs, and software

Students meet Avogadro's law when a textbook moves from particle pictures of equal volumes to quantitative mole and volume proportions, when a lab asks how many moles remain after a piston expands at constant temperature, or when a stoichiometry problem couples gas volume changes to limiting-reactant checks under fixed T and P. Teachers can pre-generate answer keys for modest volumes and moles without trusting opaque calculator apps that silently switch units or drop the constant-T-and-P assumption.

Developers call the same contract from scripts to seed deterministic test vectors for gas-law tutors, to normalize user-entered V1, V2, and n1 before a multi-step ideal-gas demo, or to satisfy programming-challenge statements that demand n2 rather than a hand-waved sketch. Contest practice often needs a fast, offline source of mole-change answers so solutions can be checked without graphing calculators under time pressure.

Product and education tools use the rearrange when a learner types initial and final volumes with an initial mole amount and the UI must show the scaled final moles and the volume ratio.

Homework and lab mole checks

Scale moles with volume at constant T and P using n2 = n1 × (V2/V1) before writing lab conclusions or stoichiometry follow-ups.

Tutoring and education software

Normalize user-entered V1, V2, and n1 into final moles for step helpers, worksheets, and interactive chemistry lessons.

What does the Avogadro's law moles calculator cost?

It is free in your browser on this page.

How is n2 defined?

At constant temperature and pressure, Avogadro's law gives n2 = n1 × (V2 / V1). Volumes must use consistent units.

Does this tool solve Boyle's or the combined gas law?

No. It only rearranges Avogadro's law for final moles when T and P are constant. Use dedicated gas-law tools for pressure or temperature changes.

Why are results rounded to a precision?

Default precision is 10 decimal places; you can set precision from 0 to 15.

If 0.8 mol fill 5 litres, how many moles fit in 2.5 litres?

0.4 mol. The tool multiplies the starting moles by the ratio of the new volume to the old one, here 2.5 divided by 5, so halving the volume halves the amount of gas.

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/avogadro-law-moles

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/avogadro-law-moles \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"V1":2,"V2":4,"n1":1}'
{
  "V1": 2,
  "V2": 4,
  "n1": 1
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "chem.avogadro_law_moles",
  "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_abs_value1000000000000000
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.

What Avogadro's law computes and what the response contains

The response returns the normalized inputs V1, V2, and n1, the computed final moles n2, the volume ratio V2 over V1 so you can audit the scale factor, the precision used, a method tag avogadro_law_moles, a short formula string, and a conditions reminder that temperature and pressure are constant and that volumes must share consistent units. There is no approximate Monte Carlo path and no lookup table of molar volumes: the engine either builds exact floating-point n2 inside the supported magnitude range or rejects the input with invalid_input. Rejected cases include missing V1, V2, or n1, non-finite values, magnitudes above the documented ceiling, negative volumes or moles, and any initial volume that is zero or numerically zero, because dividing by V1 would be undefined.

How V1, V2, and n1 are read and how n2 stays reproducible

Optional leading plus signs and scientific notation on numeric strings are allowed when they parse as finite decimals; embedded spaces, hex prefixes, and non-numeric tokens are rejected with a clear message so a bad cell does not become a wrong mole count. Zero for n1 is valid and simply yields zero final moles when the volume ratio is finite. Zero for V2 is valid and yields zero final moles, corresponding to a complete contraction of the gas sample under the ideal proportion. The preferred fields are V1 for initial volume, V2 for final volume, and n1 for initial moles, but aliases v1, volume1, and initial_volume for V1, v2, volume2, and final_volume for V2, and N1, moles1, initial_moles, and n_initial for n1 are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. The initial volume V1 must be strictly positive: if absolute V1 is at or below a tiny epsilon, or if V1 is negative, the request fails with invalid_input because Avogadro's rearrange divides by V1 and negative volume is not physically meaningful for this law. An optional precision field, with aliases decimals and dp, chooses how many decimal places to expose for V1, V2, n1, n2, and the volume ratio, defaulting to ten and capped at fifteen so JSON goldens stay stable. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing the Avogadro formula yourself.

Where Avogadro mole changes fit in study, labs, and software

On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with STP volume, molarity, or combined gas-law tools when you need related chemistry steps, and with other parse endpoints when you are building a small lab of free, deterministic science helpers.

Deterministic test fixtures

Generate reproducible n2 and V2/V1 ratios for unit tests, property checks, and CI assertions on gas-law tutors.

What happens if initial volume V1 is zero?

The input is rejected with invalid_input. V1 = 0 would divide by zero in n2 = n1 × (V2/V1), so the result is undefined.

Read the full KIT documentation →