ForHosting KIT · Science

Gay-Lussac's law calculator

If a gas at 300 K in a rigid container goes from 1 atm to 2 atm, its temperature reaches 600 K. Enter the starting pressure, the starting temperature in kelvin and the new pressure to get the final temperature. 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
P1
1
T1
300
P2
2
You get
T2
600
Ratio
2
Law
gay_lussac
Conditions
constant volume and amount of substance

A Gay-Lussac final-temperature calculator turns initial pressure and absolute temperature plus a new pressure into the temperature you expect when volume and amount of gas stay fixed. Ideal-gas classroom problems, rigid-vessel heat-up estimates when only pressure is measured, and coding kata expected values all need that same direct P-T rule without opening a full equation-of-state solver.

What Gay-Lussac's law says about pressure and temperature

Gay-Lussac's law, also known as Amontons's law for a fixed volume, states that for a fixed amount of ideal gas at constant volume, pressure and absolute temperature are directly proportional: the ratio P over T is constant. In symbols, P1 over T1 equals P2 over T2, so the final absolute temperature is T2 equals T1 multiplied by the ratio P2 over P1.

If you raise the pressure of a gas in a rigid container to twice its original value while holding volume and moles fixed, the absolute temperature doubles; if pressure falls to half, absolute temperature falls to half. Temperatures must be absolute—kelvin in SI classroom work—because the proportionality is through absolute zero, not through the Celsius or Fahrenheit zero points. The law is the P-T branch of the ideal-gas family that also includes Boyle (P-V at fixed n,T), Charles (V-T at fixed n,P), and Avogadro (V-n at fixed T,P).

Teachers and automated graders care about the zero-P1 rejection as much as the happy path: a student who sets initial pressure to zero has left the domain of the ratio, and inventing an infinite temperature 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.

Pressure units are caller-chosen and consistent—atmospheres, pascals, bars, or torr all work as long as P1 and P2 share one pressure unit—while T1 and T2 are reported on the same absolute scale as the kelvin input.

Practical tips, limits, and related searches

Keep inputs inside the published absolute range so the product T1 times P2 over P1 cannot overflow into a non-finite final temperature 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. Convert Celsius to kelvin before calling—add two hundred seventy-three point fifteen—because a room-temperature sample at twenty-seven degrees Celsius is three hundred kelvin, not twenty-seven.

Near-zero initial pressure after floating cancellation is classified as zero and rejected so noise does not invent a huge temperature. Prefer this capability when volume and moles truly stay fixed and only pressure changes; if V or n also moves, use an ideal or combined gas-law tool instead. Round-trip checks are easy: recompute T1 times P2 divided by P1 by hand and confirm it equals the published t2 within the same twelve-decimal rounding, and confirm that doubling P2 at fixed P1 doubles t2.

Homework checks for P ∝ T problems

Students enter textbook P1, T1 (K), and P2 and compare hand-written final temperature and pressure ratio against a deterministic result before submitting.

Rigid-vessel heat-up estimates at fixed V

Lab notes estimate absolute temperature when a sealed fixed-volume sample is pressurized without changing amount of gas.

What is Gay-Lussac's law?

For a fixed amount of ideal gas at constant volume, pressure is proportional to absolute temperature: P1/T1 = P2/T2, so T2 = T1·(P2/P1).

Must temperature be in kelvin?

Yes. Gay-Lussac's law uses absolute temperature. Convert °C to K (T_K = t_C + 273.15) before calling; t1 must be strictly positive.

Does this convert pressure units?

No. Use any consistent pressure unit for P1 and P2; T2 is returned on the same absolute scale as T1 (kelvin).

Is the Gay-Lussac calculator free?

The browser tool is free and runs locally.

What happens if the initial pressure is zero?

The calculation is refused, because the formula divides by the initial pressure and the ratio has no meaning. You get a clear message instead of an infinite temperature, so the slip is easy to spot.

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/gay-lussac-final-temperature

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/gay-lussac-final-temperature \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"p1":1,"t1":300,"p2":2}'
{
  "p1": 1,
  "t1": 300,
  "p2": 2
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "chem.gay_lussac_final_temperature",
  "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.

Enter P1, T1 in kelvin, and P2; the tool returns T2 equals T1 times P2 over P1, the pressure 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 pressure is zero the ratio is undefined, so the API returns invalid_input instead of infinity or a silent nonsense temperature.

How to call the API and what comes back

Initial pressure p1 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. Initial temperature t1 must be strictly positive absolute kelvin; final pressure p2 must be strictly positive. Send a JSON body with three required finite numbers: p1 (aliases P1, pressure1, initial_pressure, p_initial), t1 (aliases T1, temperature1, initial_temperature, t_initial), and p2 (aliases P2, pressure2, final_pressure, p_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 p1, t1, and p2, sets t2 to the computed final temperature, ratio to P2 over P1, formula to the string T2 equals T1 times P2 over P1, law to gay_lussac, conditions to constant volume and amount of substance, unit_pressure and unit_temperature 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, zero or negative initial pressure, non-positive temperature or final pressure—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: P1 equals one atmosphere with T1 equals three hundred kelvin and P2 equals two atmospheres yields T2 equals six hundred kelvin; equal pressures leave temperature unchanged; and P1 equals zero demonstrates the hard invalid_input path that protects division by zero. This landing targets people searching for a Gay-Lussac law calculator, final temperature from pressure change, or P1 over T1 equals P2 over T2 online; it is not a full ideal-gas PV equals nRT solver, not a Boyle volume tool, and not a unit converter for Celsius or Fahrenheit. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately set P1 to zero.

Unit tests for gas-law helpers

Generate known-good T2 cases plus deliberate P1-equals-zero rejections for coding kata expected values and CI fixtures.

What happens when initial pressure is zero?

The ratio is undefined. This tool returns invalid_input instead of infinity or a nonsense temperature.

Read the full KIT documentation →