How the ideal gas law works
The ideal gas law, PV = nRT, ties together the four properties that describe a gas sample: pressure, volume, the amount of gas in moles, and absolute temperature. R is the gas constant that makes the units balance.
Choose which variable you want to find, then enter the other three. The calculator rearranges the equation to isolate your chosen quantity and solves it directly. It uses R = 0.082057 L·atm/(mol·K), with pressure in atmospheres, volume in liters, amount in moles, and temperature in kelvin.
Using the result
Because all four quantities are linked, the law lets you predict how a gas responds when conditions change. Solving for volume at a new temperature, for example, shows how much a balloon expands as it warms.
- Solve for moles to estimate how much gas occupies a known container.
- Solve for pressure to check whether a vessel stays within a safe limit.
Keep your units consistent
The chosen gas constant fixes the units you must supply. Temperature in particular must be absolute.
- Convert Celsius to kelvin by adding 273.15 before entering it.
- Convert other pressure units (kPa, bar, psi) to atmospheres first.
- Volume should be in liters to match the constant used here.
Caveats and common mistakes
The law assumes an ideal gas with no molecular volume or attraction. Real gases deviate from it at high pressure and low temperature, where corrections such as the van der Waals equation become necessary.
The most frequent mistake is entering temperature in degrees Celsius instead of kelvin, which throws off every result.
Formula
PV = nRT, R = 0.082057 L·atm/(mol·K)Frequently asked questions
- What is the ideal gas law?
- PV = nRT — pressure times volume equals the number of moles times the gas constant times absolute temperature. Knowing any three fixes the fourth.
- What units does this expect?
- Atmospheres for pressure, liters for volume, moles for amount and kelvin for temperature, using R = 0.082057 L·atm/(mol·K).
- Why must temperature be in kelvin?
- The law is proportional to absolute temperature. Using Celsius would make zero degrees mean zero energy, which is wrong — add 273.15 to convert.

