Thermal & Fluid Sciences

Ideal Gas Law Simulator

Pressure, volume, temperature and amount — linked, with the isotherm drawn under the state point.

Standards: pV = nRT Format: browser simulator Cost: free, no sign-up Reviewed: November 2026
Ideal Gas Law Simulator — live pV = nRT
Move the volume and the state point slides along the same isotherm — pressure rises but temperature does not.

Inputs

1 mol
24.5 L
25 °C

Presets

Pressure101.18 kPa
Pressure in bar1.012 bar
Pressure in atm0.999 atm
Absolute temperature298.1 K
Mass of gas28.97 g
Density1.182 kg/m³
Specific gas constant287.0 J/kgK
RMS molecular speed507 m/s

Every number below is substituted from the current input state — change a slider and the arithmetic changes with it.

Ideal gas law
→ p = nRT/V = (1 × 8.314 × 298.1) / 0.0245 = 101.18 kPa
Molar mass
→ M(Air) = 28.97 g/mol → R_specific = 8.314 / 0.0290 = 287.0 J/kgK
Density
→ ρ = pM/(RT) = 1.182 kg/m³
Kinetic theory
→ v_rms = √(3RT/M) = 507 m/s

At 1.00 atm the ideal-gas assumption is reasonable for air; real-gas corrections matter above roughly 20 bar or near the saturation line.

Practice problem

The ideal gas law is one equation with four variables, which means it is really four useful calculators depending on which one you solve for. Fix any three and the fourth follows.

This simulator fixes amount, volume and temperature and reports pressure, then draws the isotherm so you can see the inverse relationship between pressure and volume at constant temperature — the curve that Boyle’s law describes.

One equation, three useful rearrangements

Solved for pressure it is p = nRT/V, the version used here. Solved for volume it gives the molar volume — 22.4 L at 0 °C and 1 atm, the number every chemistry course quotes. Solved for density it becomes ρ = pM/(RT), which is how gas density tables are generated.

The specific gas constant R_specific = R/M is the form engineers use, because it works in mass units: p = ρR_specific·T. For air that constant is 287 J/kgK, and it appears in everything from compressor work to duct pressure drop.

When the ideal assumption holds

The model assumes molecules have negligible volume and no intermolecular forces. Both assumptions degrade at high pressure and low temperature — precisely the conditions where a gas approaches its saturation line.

A useful rule of thumb: below about 5 bar and above twice the boiling point, errors are usually under a few percent. Near the critical point, or in refrigeration cycles, you need a real-gas equation of state or tabulated properties.

Molar mass and the speed of the molecules

Helium is seven times lighter than air but only about 2.7 times faster in RMS speed, because speed scales with the square root of the mass ratio. That square root is why lighter gases leak faster but not proportionally so.

GasM (g/mol)Density at 25 °C, 1 atmv_rms (m/s)
Air28.971.18 kg/m³507
Helium4.000.164 kg/m³1360
Carbon dioxide44.011.80 kg/m³412
Argon39.951.63 kg/m³432
Methane16.040.657 kg/m³681

Two traps in gas calculations

The first is temperature units: every gas equation needs absolute temperature. Using 25 instead of 298 K gives a pressure wrong by a factor of twelve, and it is the single most common error in hand calculations.

The second is mixing up mass and moles. A kilogram of helium is 250 mol; a kilogram of carbon dioxide is 22.7 mol — an eleven-fold difference in the amount of substance, and therefore in pressure at the same volume and temperature.

Frequently asked questions

Why does the isotherm curve rather than run straight?

Because pressure is inversely proportional to volume at fixed temperature. Doubling the volume halves the pressure, so the curve is a hyperbola — steep at small volumes, flat at large ones.

Can I use this for steam?

Only as a rough estimate for superheated steam far from saturation. Near the saturation line, steam properties must come from tables or a real-gas formulation; the ideal gas law can be wrong by tens of percent.

What is the RMS speed used for?

It sets the scale of molecular transport: diffusion, viscosity and thermal conductivity of a gas all rise with molecular speed. It also explains why sound travels faster in helium — the speed of sound is comparable to the RMS speed.

Does the gas identity change the pressure at fixed n, V and T?

No — that is the point of the ideal gas law. Pressure depends on the number of molecules, not their mass. Mass matters for density and for the speed of the molecules, not for the pressure they exert at a given temperature.

BR

Written and reviewed by Bloom Rocket editorial desk

Bloom Rocket is built and maintained by a small independent team. Every page states the equations it implements and the standards it references, so the working can be checked rather than taken on trust.

How these simulators are built and checked →

Keep going

More thermal simulators

All Thermal →