The ideal gas law, PV = nRT, ties a gas's pressure, volume, amount and absolute temperature together. Drag the sliders below to change the moles, temperature (in kelvin) and volume, and watch the pressure respond — with Boyle's, Charles's and Gay-Lussac's laws falling out when you hold one fixed.

What Is the Ideal Gas Law Simulator?

The Ideal gas law simulator is a free interactive physics lab that runs in your browser — nothing to install and no sign-up. Change the moles, temperature and volume and watch the pressure respond through PV = nRT. It reports pressure, Molecules and Molar volume Vm as you drag the sliders.

What you can change in the Ideal gas law simulator
ControlRangeStep
Amount of gas0.10 – 5.00 mol0.01
Temperature100 – 800 K0.05
Volume1.0 – 50.0 L0.001

Three gas laws hiding inside PV = nRT

The single line PV = nRT quietly holds Boyle's, Charles's and Gay-Lussac's laws inside it; each one surfaces the moment you freeze a quantity in place. This simulation seals a fixed sample of nitrogen and hands you three sliders — Amount of gas n in moles, Temperature T in kelvin, and Volume V in litres — then solves P = nRT/V live, printing the pressure P and the molar volume (V/n) beside a fixed constant R = 8.314 J/(mol·K).

Watch how P responds: it climbs as you add moles or raise temperature, and sinks as the volume opens up. The preset buttons lock one variable so a named law stands alone. Hold n and T and you get Boyle's law, with P proportional to 1/V — halve the volume, double the pressure. Hold n and P for Charles's law, V proportional to T; hold n and V for Gay-Lussac's law, P proportional to T.

One trap catches everyone: T is absolute temperature. Doubling it truly doubles the pressure only in kelvin — 200 K to 400 K works, but 20°C to 40°C does not, because those are really 293 K and 313 K, a rise of under ten percent. Remember this is the ideal model — point molecules with no forces — so real gases drift off at high pressure or low temperature. Put numbers to it in the ideal gas law calculator, or bend other equations by hand across our collection of physics playgrounds.

Frequently asked questions

What is the ideal gas law?

The ideal gas law, PV = nRT, links the pressure, volume, amount (in moles) and absolute temperature of a gas, with the gas constant R = 8.314 J/(mol·K). It rearranges to P = nRT/V.

Why must the temperature be in kelvin?

Because the law uses absolute temperature. Doubling the temperature doubles the pressure only in kelvin (200 K to 400 K); it does not work in Celsius, since 20 °C to 40 °C is really 293 K to 313 K — a rise of under ten percent.

What are Boyle's, Charles's and Gay-Lussac's laws?

They are special cases of PV = nRT. Holding n and T gives Boyle's law (P inversely proportional to V); holding n and P gives Charles's law (V proportional to T); holding n and V gives Gay-Lussac's law (P proportional to T).

When does a real gas stop obeying the ideal gas law?

At high pressure or low temperature, near where it condenses to a liquid, because real molecules take up space and attract one another — effects the ideal model ignores.

References & formula source

  • Halliday, Resnick & Walker — Fundamentals of Physics, Chapter 19 (The Kinetic Theory of Gases).
  • Young & Freedman — University Physics with Modern Physics, §18.1 (Equations of State; the Ideal-Gas Equation).
  • R. Nave — HyperPhysics, Georgia State University, "Ideal Gas Law" section.
  • Further reading: Ideal gas law — Wikipedia