What this calculator does
The ideal gas law ties together the four things that describe a gas: pressure, volume, temperature and how much of it there is. Fix any three and the fourth follows, which is what makes PV = nRT one of the most useful equations in chemistry.
The one rule that catches people out is temperature. The equation needs absolute temperature in kelvin, not celsius, because it depends on the true thermal energy rather than on a scale whose zero was chosen for convenience. This calculator takes celsius and converts internally.
The formula
Rearranging PV = nRT gives n = PV divided by RT, with pressure converted to pascals, volume to cubic metres and temperature to kelvin by adding 273.15. R is the gas constant, 8.314 joules per mole per kelvin.
| Term | Meaning |
|---|---|
| Mole | A fixed count of particles, about 6.022 × 10²³. It is the unit chemistry uses to connect a number of molecules to a measurable mass. |
| Gas constant (R) | The constant linking the pressure, volume, temperature and amount of an ideal gas: 8.314 J/(mol·K). |
| STP | Standard temperature and pressure, a fixed reference point used so that gas volumes can be compared on equal terms. |
The inputs explained
| Field | What to enter |
|---|---|
| Pressure (kPa) | The pressure of the gas, in kilopascals. Standard atmospheric pressure is 101.325 kPa. |
| Volume (litres) | The volume the gas occupies, in litres. |
| Temperature (°C) | The temperature in degrees celsius. It is converted to kelvin internally, so entering a value below −273.15 is rejected. |
When to use it
Finding how much gas a container holds
From a known volume, pressure and temperature, the number of moles follows directly, which then converts to a mass if the gas is known.
Predicting the effect of a temperature change
Heating a sealed container raises pressure in proportion to absolute temperature, which is why aerosol cans carry heat warnings.
Comparing gas volumes fairly
A volume of gas is meaningless without its pressure and temperature, so converting to moles or to a volume at STP is how two samples are compared.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How much gas fits in 22.4 litres as temperature rises?
The same container at atmospheric pressure across a range of temperatures.
| Temperature | Moles of gas | Volume at STP |
|---|---|---|
| 0°C | 0.9994 mol | 22.401 litres |
| 25°C | 0.9156 mol | 20.523 litres |
| 100°C | 0.7316 mol | 16.398 litres |
Questions
Why must temperature be in kelvin?
Because the relationship is proportional to absolute temperature, and the celsius zero is an arbitrary point rather than the true zero of thermal energy. Doubling from 10°C to 20°C is not doubling the temperature in the sense the equation needs, whereas doubling from 150 K to 300 K is.
What makes a gas "ideal"?
The assumption that molecules take up no space and do not attract each other. Real gases follow the law closely at ordinary pressures and temperatures, and depart from it when cold or highly compressed, which is precisely when those assumptions break down.
Why is one mole about 22.4 litres?
It falls out of the equation at 0°C and one atmosphere. Because the law does not mention what the gas is made of, any ideal gas occupies the same volume per mole under the same conditions, which is a surprising and genuinely useful result.
What happens if I halve the volume?
At constant temperature, pressure doubles. That is Boyle's law, and it is simply this equation with temperature and amount held fixed.
For a gas dissolved in solution rather than in a container, see the molarity calculator. For the energy needed to heat a substance, see the specific heat calculator.