Ideal gas in a box: interactive simulation
Gas pressure is simply molecules hitting the walls. More molecules, faster molecules or a smaller box all mean more hits per second, and so more pressure.
Useful for: JEE Main, NEET
Try this
Each control here changes one of n, T or V. The pressure is calculated from PV = nRT with R = 8.314 J mol⁻¹ K⁻¹, and the particles speed up as you heat the gas, just as kinetic theory predicts.
- 1
Use the Room preset: 1 mol, 300 K, 24.9 L.
What you should see
P ≈ 100 kPa, about 1 atm.
- 2
Halve the volume without changing anything else.
What you should see
The pressure doubles (Boyle’s law) and the wall-hit counter roughly doubles too.
- 3
Double the temperature in kelvin at fixed volume.
What you should see
The pressure doubles and the particles move visibly faster.
- 4
Watch the PV / nT readout while you change anything.
What you should see
It always stays at 8.314 — that constant is R.
Formulas behind it
Ideal gas equation
Boyle’s law (n, T fixed)
Charles’s law (n, P fixed)
Average kinetic energy
Common mistakes
- Using °C instead of kelvin in gas-law calculations.
- Mixing litres with SI units: 1 L = 10⁻³ m³.
- Assuming 22.4 L per mole at room temperature. It is 22.4 L only at 0 °C and 1 atm (about 22.7 L at the IUPAC STP of 1 bar).
FAQ
When does a real gas behave like an ideal gas?
At low pressure and high temperature, when molecules are far apart and attractions between them matter little.
Why does pressure rise when a gas is heated in a closed container?
Hotter molecules move faster, so they hit the walls more often and harder.
What is the value of R in different units?
8.314 J mol⁻¹ K⁻¹ = 0.0821 L atm mol⁻¹ K⁻¹ = 0.0831 L bar mol⁻¹ K⁻¹.
Related simulations
All 65 simulationsWant a specific topic or simulation added?
Tell us in our feedback box which chapter or concept you want visualised next.