Thermodynamics  ·  29 July 2026

Ideal Gas Law Calculator: PV = nRT and Kinetic Theory Explained

Squeeze a balloon and it pushes back harder. Heat a sealed can and, if you're not careful, it can rupture. Both are the same physics: gas pressure responding to being confined into less space, or to its molecules moving faster — and both are captured completely by one compact equation that every chemistry and physics student meets sooner or later: PV=nRTPV = nRT.

This page is an ideal gas law calculator built around the microscopic picture that explains why the equation works: kinetic theory, where gas pressure is nothing more than countless molecular collisions against a container's walls. It builds in three steps: an animated particle-in-a-box view that makes the kinetic-theory picture literal, a calculator with real-world presets — a bicycle tire, a scuba tank, a weather balloon — and an explorer showing how Boyle's, Charles's, and Gay-Lussac's laws are all the same equation in disguise.

What Is the Ideal Gas Law? (PV = nRT)

The ideal gas law relates four measurable properties of a gas:

PV=nRTPV = nRT

where PP is pressure, VV is volume, nn is the amount of gas in moles, TT is absolute temperature in kelvin, and RR is the universal gas constant. Using litres and atmospheres — the units most exam problems expect — R=0.0821R = 0.0821 L·atm/(mol·K).

A famous checkpoint worth memorising: at standard temperature and pressure (STP, 0 °C and 1 atm), one mole of any ideal gas occupies exactly 22.4 litres. Plug those numbers in yourself: P=nRT/V=(1)(0.0821)(273)/22.41.00P = nRT/V = (1)(0.0821)(273)/22.4 \approx 1.00 atm — confirming the definition. The simulator below opens on precisely this configuration.

What Is Kinetic Theory? Why Does Gas Have Pressure at All?

Kinetic theory explains pressure from the bottom up: a gas is an enormous number of molecules in constant, random motion, and every time one collides with a container wall, it delivers a tiny push. Pressure is simply the combined effect of billions of these collisions per second, averaged over the wall's area. Squeeze the same number of molecules into a smaller container and they hit the walls more often — pressure rises. Heat the gas and the molecules move faster, hitting the walls harder and more frequently — pressure rises again, at fixed volume.

This microscopic picture is why the Maxwell-Boltzmann velocity distribution exists: molecules in a gas don't all move at one single speed — they spread across a whole range of speeds, and temperature describes the average of that distribution's kinetic energy, not any one molecule's individual speed.

Interactive Kinetic Theory Simulator

Drag the temperature slider and watch the particles visibly speed up — this is kinetic theory's central claim made literal: temperature is average molecular kinetic energy, not a separate, independent quantity. Shrink the volume slider and the container itself visibly shrinks around the same particles.

Loading chart...
Gas
1 mol
22.40 L
273 K
Particles Shown
40
Raise the temperature and the particles visibly speed up — that is kinetic theory's central claim: temperature is average molecular kinetic energy, not a separate quantity.
P = nRT/V = 1.001 atm · v_rms (O₂) = 461.3 m/s at 273 K

This is a conceptual picture, not a literal simulation: particles bounce only off the container walls, never off each other (the "ideal" simplification the law is named for), and the container's on-screen size is a visual stand-in for volume rather than a to-scale rendering.

What Is the Formula for Molecular Speed? (Root-Mean-Square Speed)

Kinetic theory connects temperature directly to a typical molecular speed through the root-mean-square speed:

vrms=3RTMv_{rms} = \sqrt{\frac{3RT}{M}}

where MM is the gas's molar mass in kilograms per mole and R=8.314R = 8.314 J/(mol·K) (the SI form of the gas constant, needed here since this formula works in metres per second). Lighter molecules move faster at the same temperature — this is why helium balloons deflate faster than air-filled ones: small, light helium atoms leak through microscopic gaps in the balloon material far more readily than heavier nitrogen and oxygen molecules.

Ideal Gas Law Calculator: Real-World Examples

The calculator below solves PV=nRTPV = nRT directly: set moles, volume, and temperature, and read off the resulting pressure. Try the presets — a bicycle tire, a scuba tank, and a weather balloon rising toward the stratosphere — to see how differently the same equation plays out depending on what's actually being compressed or heated.

Loading chart...
Loading chart...
Jump to a Real-World Scenario
Your Inputs
1 mol
22.40 L
273 K
The piston's height is the container's volume; the same handful of dots always represents the gas inside, just packed tighter or looser as the piston moves.
P = nRT/V = 1.0006 atm

The weather balloon preset is the most dramatic: pressure drops to roughly a tenth of an atmosphere as the balloon nears the stratosphere, which is why these balloons expand so much as they climb, and occasionally burst before completing their ascent.

How Are Boyle's, Charles's, and Gay-Lussac's Laws Related to PV = nRT?

Three relationships taught separately in most introductory courses are really the same equation, PV=nRTPV = nRT, with different pairs of variables frozen. Hold temperature and the amount of gas fixed and pressure and volume trade off along a hyperbola — Boyle's law. Hold pressure and amount fixed instead and volume grows in direct proportion to temperature — Charles's law. Hold volume and amount fixed and pressure itself grows in direct proportion to temperature — Gay-Lussac's law.

Loading chart...
Which Law?
Volume V
22.40 L
Temperature T
273 K
All three laws are the same equation, PV = nRT, with two of its four variables frozen — switch between them to see which pair trades off.
Boyle's Law: T and n held fixed — P and V trade off

Switch between the three modes above and watch the same underlying equation produce a different curve shape each time, depending on which pair of variables has been frozen — a distinction that shows up constantly in exam questions asking which named law applies to a given scenario.

When Does the Ideal Gas Law Stop Working?

The law assumes molecules take up no volume of their own and never attract or repel each other, colliding only elastically, an excellent approximation at low pressure and high temperature, where molecules are spread far apart and moving fast. It breaks down as a gas is pushed toward the conditions where it would condense into a liquid: squeeze it to high enough pressure, or cool it enough, and the molecules' own volume and their mutual attraction both become significant, and the simple PV=nRTPV=nRT relationship starts measurably disagreeing with reality. This is the same territory our anomalous expansion of water post explores from a different angle — a simple model breaking down once a substance's own microscopic structure starts to matter. Our triple point post covers the pressure-temperature conditions where a substance stops behaving like a simple gas at all, coexisting instead as solid, liquid, and vapour simultaneously.

Worked Examples for Physics Exams

Example 1: Finding pressure directly

2 moles of an ideal gas occupy 10 L at 300 K. Find the pressure.

P=nRT/V=(2)(0.0821)(300)/10=49.26/104.93P = nRT/V = (2)(0.0821)(300)/10 = 49.26/10 \approx 4.93 atm.

Example 2: Boyle's law — compressing a gas

A gas at 2 atm occupying 15 L is compressed to 5 L at constant temperature. Find the new pressure.

P1V1=P2V2    P2=P1V1V2=2×155=6P_1V_1 = P_2V_2 \implies P_2 = \dfrac{P_1V_1}{V_2} = \dfrac{2 \times 15}{5} = 6 atm — no need for the full ideal gas law at all, since nn and TT never changed.

Example 3: Root-mean-square speed of oxygen at room temperature

Find the root-mean-square speed of oxygen molecules (M=0.032M = 0.032 kg/mol) at T=300T = 300 K.

vrms=3RT/M=(3)(8.314)(300)/0.032=7,482.6/0.032=233,831484v_{rms} = \sqrt{3RT/M} = \sqrt{(3)(8.314)(300)/0.032} = \sqrt{7{,}482.6/0.032} = \sqrt{233{,}831} \approx 484 m/s — roughly 1,740 km/h, faster than a commercial jet, and yet an ordinary room full of oxygen feels perfectly still, because molecules travel in every direction at once and collide constantly, cancelling out any overall drift.

Example 4: Which law applies?

A sealed can of gas is heated on a stove. Its volume can't change and no gas escapes. If the pressure starts at 1 atm at 293 K and the can is heated to 353 K, which named law applies, and what's the new pressure?

Volume and the amount of gas are both fixed here, so Gay-Lussac's law applies: P1/T1=P2/T2    P2=P1×T2/T1=1×353/2931.205P_1/T_1 = P_2/T_2 \implies P_2 = P_1 \times T_2/T_1 = 1 \times 353/293 \approx 1.205 atm — a 20% pressure rise from heating alone, which is why sealed containers carry warnings against being heated.

Example 5: Cross-checking the weather balloon preset

A weather balloon carries 200 moles of gas in a 40,000 L envelope at 220 K near the edge of the stratosphere. Find the pressure.

P=nRT/V=(200)(0.0821)(220)/40,000=3,612.4/40,0000.090P = nRT/V = (200)(0.0821)(220)/40{,}000 = 3{,}612.4/40{,}000 \approx 0.090 atm. Verify in the calculator: select the "Weather balloon (altitude)" preset — the readout matches this figure exactly.

Frequently Asked Questions

Explore more simulations

Every concept on PhysicStuff has an interactive simulation. No login, no setup required.