Ideal gas law calculator

Solve PV = nRT for whichever one you are missing. There is more than one number called R, and picking the wrong one for your units is a hundredfold error that nothing in the expression flags. Nothing you type here leaves your browser — it is worked out on your own device, so there is nothing to send and nothing to log.

There is more than one number called R

The gas constant is not one number. It is one quantity, and its number depends entirely on the units you express it in:

Pascals and cubic metres8.31446261815324
Litres and atmospheres0.08205736608
Litres and kilopascals8.31446261815324 again

That third row is the trap. Kilopascals with litres happens to give the same number as the SI form, so the habit of reaching for 8.314 survives every problem posed in those units — and then meets a pressure in atmospheres and is out by a factor of 101.325.

One mole at 0°C and 1 atm22.414 L
The same sum with the SI R2271 L

This page converts everything to SI first. That is not tidiness. It means only one gas constant is ever in play — the exact one — and there is no opportunity to pair the wrong R with the wrong pressure. It tells you what R is in your units so you can see the size of what you avoided.

The constant is exact, and that is new

Since the SI redefinition of 20 May 2019, the gas constant is exact by definition. It is the Avogadro constant times the Boltzmann constant, and both of those are now defined values — fixed integers times powers of ten — rather than quantities anybody measures.

R = NA × k = 6.02214076×1023 × 1.380649×10−23

So 8.31446261815324 is not a measurement with an uncertainty hiding behind the last digit. It is a definition, and it will not be revised. The molar volume of 22.414 L is not stored anywhere in this page's code either — it falls out of the arithmetic, which is how you can tell it was derived rather than copied.

What "ideal" is doing in the name

The law assumes molecules take up no space and do not attract one another. Real gases do both, and the assumption fails where it matters most: at high pressure, at low temperature, and near condensation. Near room conditions and a few atmospheres it is good to about a per cent, which is why it survives as the first thing anybody learns.

If you need better, the van der Waals equation adds two constants per gas — measured ones, different for every substance. This page does not do that, because it would need a table of measurements and the honest place for those is a source that published them.

Where to go next