Ideal Gas Law Calculator

Explore the ideal gas law. Lock one variable and solve for it from the other three.

Loading interactive simulation...

Why R is 8.314 in two different unit systems 🖖

The panel prints R = 8.314 L·kPa·mol⁻¹·K⁻¹, while the textbook value is 8.314 J·mol⁻¹·K⁻¹ — the same digits, and that is neither a coincidence nor a rounding. One litre-kilopascal is one joule: 10⁻³ m³ × 10³ Pa = 1 Pa·m³ = 1 J, exactly. This tool takes volume in litres and pressure in kilopascals precisely so that no conversion factor ever appears in the working it shows you. Ask it for one mole at 273.15 K in 22.414 L and it returns 101.3 kPa — standard atmospheric pressure, out of a formula with no unit fudge anywhere in it.

One equation, four knobs, one universal constant 🖖

The tool locks three of the quantities P, V, n, T and lets you drag the fourth; PV = nRT then forces the rest to respond. The constant R is the same for every gas, so helium and carbon dioxide obey identical arithmetic — a given amount fills the same volume at equal temperature and pressure, whatever the molecule. That is the quiet power of the ideal model: the chemistry disappears, and only the number of particles counts.

Every gas line points to −273.15 °C 🖖

Plot volume against temperature at fixed pressure and extend the line backwards: for every gas it crosses zero volume at exactly −273.15 °C. No one has ever cooled a gas that far — the number comes purely from extrapolating a ruler-straight line, a trick Guillaume Amontons noticed around 1700. That vanishing point is the zero of the Kelvin scale, which is why the T in PV = nRT must always be measured in kelvin, never in degrees Celsius.

THE GAS LAWS — ONE EQUATION, AND WHICHEVER VARIABLE YOU HOLD STILL

Which Gas Law Is Your Problem?

There is only one gas law, PV = nRT. The named ones — Boyle, Charles, Gay-Lussac — are just that equation with one variable pinned down and n unchanged, which is what a sealed container gives you. So the question is never "which formula", it is "what is being held constant?" Find that, cancel it from both sides, and the named law falls out.

Nothing fixed — the full equation, PV = nRT PV = nRT
Temperature fixed — Boyle: squeeze it and the pressure rises P₁V₁ = P₂V₂
Pressure fixed — Charles: heat it and it expands V₁/T₁ = V₂/T₂
Volume fixed — Gay-Lussac: heat it and the pressure climbs P₁/T₁ = P₂/T₂

01

Nothing fixed — the full equation, PV = nRT

What you know: You have three of the four quantities and want the fourth. No process is happening; this is a single state of the gas.

Relation: PV = nRT

Worked example: 1 mol at 273.15 K and 101.325 kPa → V = nRT/P = 22.4 L, the molar volume at standard temperature and pressure

Open this case: STP
Nothing fixed — the full equation, PV = nRT. One state, four quantities, one equation — no process, nothing held constant. You have three of the four quantities and want the fourth. No process is happening; this is a single state of the gas.
One state, four quantities, one equation — no process, nothing held constant.

02

Temperature fixed — Boyle: squeeze it and the pressure rises

What you know: A sealed container at constant temperature. n and T both cancel, so PV is a constant: P₁V₁ = P₂V₂.

Relation: P₁V₁ = P₂V₂

Worked example: 200 kPa in 10 L at 300 K → halve the volume to 5 L and the pressure doubles to 400 kPa; the gas holds 0.80 mol throughout

Open this case: Boyle's Law
Temperature fixed — Boyle: squeeze it and the pressure rises. Isothermal: the P–V curve is a hyperbola, and the product PV never moves. A sealed container at constant temperature. n and T both cancel, so PV is a constant: P₁V₁ = P₂V₂.
Isothermal: the P–V curve is a hyperbola, and the product PV never moves.

03

Pressure fixed — Charles: heat it and it expands

What you know: The gas can push a piston or a balloon skin, so pressure stays at ambient while temperature changes. V/T is constant.

Relation: V₁/T₁ = V₂/T₂

Worked example: 22.4 L at 273.15 K heated to 546.3 K at constant pressure → V = 44.8 L, exactly double

Open this case: Charles's Law
Pressure fixed — Charles: heat it and it expands. Isobaric: volume rises in a straight line with absolute temperature. The gas can push a piston or a balloon skin, so pressure stays at ambient while temperature changes. V/T is constant.
Isobaric: volume rises in a straight line with absolute temperature.

04

Volume fixed — Gay-Lussac: heat it and the pressure climbs

What you know: A rigid sealed container. Nothing can expand, so the added energy shows up as pressure: P/T is constant.

Relation: P₁/T₁ = P₂/T₂

Worked example: 101.325 kPa at 273.15 K heated to 546.3 K in a rigid vessel → P = 202.65 kPa, doubled

Open this case: Gay-Lussac
Volume fixed — Gay-Lussac: heat it and the pressure climbs. Isochoric: with the volume locked, temperature and pressure rise together. A rigid sealed container. Nothing can expand, so the added energy shows up as pressure: P/T is constant.
Isochoric: with the volume locked, temperature and pressure rise together.
References (2)

Problem solved in full

  1. One mole of gas occupying 22.4 litres at one atmosphere 5 steps

    One mole of gas occupies 22.4 litres at one atmosphere. Every textbook says that is 0 °C. The panel above says −0.16 °C. Find out which is wrong, and account for every last kelvin of the difference.

    1. Rearranging for temperature is the easy part, and it is worth noticing that once three of the four quantities are fixed there is no room left for the answer to be anything else.

    2. Substituting gives 272.99 K, which is −0.16 °C rather than zero. The arithmetic is not in doubt, so either the gas law is wrong at this scale, or one of the three inputs is not the number it claims to be.

    3. Test the inputs by running the same equation the other way: what volume does one mole actually occupy at exactly 273.15 K? Not 22.4 litres — 22.4127.

    4. So the input was rounded, by 0.057%. And with pressure and amount held fixed, T is directly proportional to V, so that relative error passes through untouched: 0.057% of 273.15 K is 0.155 K.

    5. The shortfall to account for was 273.15 − 272.99 = 0.16 K. It is the rounding, all of it, with nothing left over.

    Answer

    The tool prints 272.99 K from 101.33 kPa and 22.400 L, and it is right. So is the textbook: the molar volume at standard conditions really is 22.4127 L, and "22.4" is that number to three significant figures. The 0.16 K is not a defect in the gas law, the tool, or the book — it is what happens when a rounded input meets an exact relationship and the output is read to five figures. Type 22.4127 into the volume field and the temperature snaps to 273.15. That is significant-figure discipline in one screen: because TV conserves relative error, a three-figure input can never justify a five-figure answer.

Example problems

  • STP - One mole in 22.400 L at standard pressure implies 272.99 K — a fraction below 0 °C.
  • Boyle's Law - Squeeze that mole into 10.000 L at 200.00 kPa and the implied temperature falls to 240.56 K.
  • Charles's Law - Charles: solve for volume instead, and 273.15 K at 101.33 kPa fills 22.413 L.
  • Gay-Lussac - Gay-Lussac: hold the volume and solve for pressure — 273.15 K in 22.400 L pushes 101.38 kPa.