What you enter stays on your device while you use this tool. Opening a shared link sends the settings in its address to HowToolbox to prepare the page.
Gas particles in a box
Key values as a table
| Quantity | Value |
|---|---|
| Molecules | 150 |
| Temperature | 300 K |
| Ideal gas law, P = NkT/A | 414 µN/m |
| Measured from the wall collisions | — |
Key values as a table
| Quantity | Value |
|---|---|
| Most probable speed | 298 m/s |
| Mean speed | 374 m/s |
| Root-mean-square speed | 422 m/s |
| Mean speed in the box now | 374 m/s |
| Mean kinetic energy, kT | 4.14 zJ |
- Ideal gas law, P = NkT/A
- 414 µN/m
- Measured from the wall collisions
- —
- Most probable speed
- 298 m/s
- Mean speed
- 374 m/s
- Root-mean-square speed
- 422 m/s
- Mean kinetic energy, kT
- 4.14 zJ
Nitrogen at 300 K: the molecules move at 374 m/s on average and most often at 298 m/s. Heat it and they hit the walls harder and more often, so the push grows in proportion to the temperature. This is a flat 2-D model, so pressure is force per length, not per area.
Watch gas molecules bounce in a box, change the temperature and the number, and compare the pressure with the ideal gas law.
The box fills the screen with play, step and speed controls on it, zoom in on the molecules, and the speed curve sits in its own tab.
How to use
- Press Play on the picture and watch the molecules bounce around the box. Set the temperature, the gas, the number of molecules and the width of the box in the panel under it.
- Drag the right wall of the box to squeeze the gas, or drag the peak of the speed curve to change the temperature.
- Compare the pressure measured from the wall collisions with the ideal gas law, and watch the histogram of the speeds settle on the curve.
How it works
A gas is a crowd of molecules flying in straight lines and bouncing off the walls. Each bounce pushes the wall a little; billions of bounces a second add up to a steady pressure. A hotter gas has faster molecules, so each bounce pushes harder and more often. A smaller box makes the bounces more frequent.
Kinetic theory puts numbers on it. The molecules do not all move at the same speed: their speeds follow the Maxwell–Boltzmann distribution, which gives the most probable speed √(kT/m) in this flat box, with k the Boltzmann constant, T the temperature and m a molecule's mass. Light molecules such as hydrogen are faster than heavy ones such as carbon dioxide at the same temperature. The ideal gas law says that pressure times area equals N·k·T, with N the number of molecules.
For example, 150 nitrogen molecules at 300 K in this box press on the walls with 414 µN/m. The simulation is a flat, two-dimensional box, so pressure is a force per length instead of per area, the molecules do not collide with each other (an ideal gas) and time is slowed down by a factor of about ten trillion. Source: OpenStax University Physics, volume 2, chapter 2.
Worked example
What pressure do 150 nitrogen molecules make at 300 K in this box?
- P = N·k·T / A, with the box area A = 1,500 nm².
- That is 414 µN/m.
- The molecules' root-mean-square speed is 422 m/s.
414 µN/m, with the molecules moving at about 422 m/s.
Frequently asked questions
Why does the measured pressure wobble?
The pressure comes from a finite number of bounces over a short time, so it jitters around the ideal value. More molecules and a longer wait make it steadier.
Do all molecules move at the same speed?
No. Collisions spread the speeds out into the Maxwell–Boltzmann distribution: a few are slow, most are near the peak and a few are fast. The temperature only fixes the overall scale.
Why are helium and hydrogen faster than nitrogen?
At one temperature all gases have the same average kinetic energy, so lighter molecules must move faster to carry the same energy.
Why is the pressure in newtons per metre?
The box is flat, a two-dimensional world, so the walls are lines. Pressure there is a force per length. In a real three-dimensional box it would be a force per area, in pascals.
Is time really that slow?
Molecules move at hundreds of metres per second, but a box 50 nanometres wide is crossed in about 50 picoseconds. The animation runs about ten trillion times slower than reality so that you can see it.
Next you might need
More in Physics
- Artificial gravity calculator, private, runs on your device
- Colour mixing: light and paint, private, runs on your device
- Cooling calculator, private, runs on your device
- Coulomb's law calculator, private, runs on your device
- Decibel calculator, private, runs on your device
- Doppler effect calculator, private, runs on your device





