Dr. Ione
Ideal Gas Law Calculator

Ideal Gas Law

Field: Chemistry

Written and maintained by the PhDino author · Last reviewed 21 September 2026 · Checked against 3 independent reference calculations · how PhDino checks its numbers

The relationship between a gas's pressure, volume, amount, and temperature.

The ideal gas law combines several simpler gas relationships (Boyle's, Charles's, and Avogadro's) into one equation that describes an idealized gas well enough for most everyday conditions. It treats gas particles as taking up negligible volume themselves and having no attractive forces between them — an approximation that holds up well at ordinary temperatures and pressures, and breaks down as a gas gets very cold or very compressed.

Because the equation links four quantities, knowing any three lets you solve directly for the fourth — which is the most common way it actually gets used: given how much gas you have and the conditions it's under, what pressure (or volume, or temperature) results.

Where it comes from

Émile Clapeyron appears to have been one of the first to put Boyle's law and Gay-Lussac's law into a single equation, in his 1834 memoir on the Carnot cycle: pv = R(267 + t), with t in degrees centigrade. Rudolf Clausius corrected the 267 to 273 in 1850 using Henri Victor Regnault's measurements, and in 1873 his student August Horstmann wrote the law per mole, which made R one constant for every gas.

Sources: Jensen (2003), Journal of Chemical Education

Key formula

PV = nRT
R = 0.08206 L·atm/(mol·K)
No. 038 / 092Chemistry
Ideal Gas Law
Presented by Dr. Ione · Chemistry
No. 038 / 092Ideal Gas Law
PV = nRT
R = 0.08206 L·atm/(mol·K)
P
pressure
V
volume
n
amount of gas, in moles
T
absolute temperature, in kelvin
Worked example
Pressure (0 = solve for it): 1 atm · Moles (0 = solve for it): 1 mol · Temperature (0 = solve for it): 273.15 K
→ Volume: 22.41 L
Checked: this exact example is one of the automated reference tests, its answer worked out independently of the calculator.
phdino.com/calc/ideal-gas-law

Variables

P
pressure
V
volume
n
amount of gas, in moles
T
absolute temperature, in kelvin
R
the ideal gas constant, whose numeric value depends on which units P and V are measured in

How to use the Ideal Gas Law calculator

Solves the ideal gas law, PV = nRT, for whichever quantity you leave blank or at 0: pressure in atmospheres, volume in litres, amount in moles, or temperature in kelvin. Fill in the other three and the fourth appears.

Use it for everyday gas sums: how much space a gas takes, how much is in a cylinder, how pressure rises as a sealed container warms. Near room temperature and at modest pressures it is accurate enough for most purposes; the reading section says when it is not.

Pressure (0 = solve for it) (atm)
Absolute pressure in atmospheres. A tyre or cylinder gauge reads pressure above the atmosphere, so add about 1 atm (14.7 psi) to a gauge reading.
Volume (0 = solve for it) (L)
The volume of the container, or of the gas, in litres.
Moles (0 = solve for it) (mol)
The amount of gas in moles: its mass divided by its molar mass. 32 g of oxygen, O₂, is 1 mol.
Temperature (0 = solve for it) (K)
Absolute temperature in kelvin: add 273.15 to a Celsius reading. Never enter °C or °F directly.

Worked example: half a mole of nitrogen at 2 atm

How much space do 0.5 mol of nitrogen, about 14 g, take at an absolute pressure of 2 atm and 27 °C? Leave the volume blank and enter the rest, with the temperature as 300 K.

You enterValue
Pressure (0 = solve for it)2 atm
Volume (0 = solve for it)0 L
Moles (0 = solve for it)0.5 mol
Temperature (0 = solve for it)300 K
The calculator returnsValue
Pressure2.000 atm
Volume6.15 L
Moles0.5 mol
Temperature300.0 K

Worked by hand:

  1. Rearrange for the unknown. PV = nRT gives V = nRT ÷ P.
  2. Put the numbers in, with R = 0.082057 L·atm/(mol·K): 0.5 × 0.082057 × 300 ÷ 2 = 6.154 L.
  3. Check it another way. One mole at 0 °C and 1 atm fills 22.414 L, so half a mole at twice the pressure would fill a quarter of that, 5.60 L, at 0 °C; warming it to 300 K multiplies that by 300/273.15, giving 6.15 L.

The nitrogen takes about 6.2 litres. The trap is the pressure: it must be absolute. If 2 atm were what a gauge on the container showed, the absolute pressure would be 3 atm and the same gas would fit in 4.1 litres, a third less. Nitrogen at a few atmospheres and room temperature behaves so nearly ideally that the answer is good to well under one percent.

Reading the result: when the ideal answer can be trusted

The ideal gas law treats molecules as points that never attract one another. Air, nitrogen, oxygen, helium and hydrogen near room temperature and up to a few atmospheres come very close to that, which is why the law is the default for everyday gas sums.

  • Deviations grow at high pressure and close to condensation. Steam, refrigerants, carbon dioxide at tens of atmospheres and any gas near its boiling point need a real-gas equation or property tables.
  • At 0 °C and 1 atm a mole of ideal gas fills 22.414 L; at 25 °C and 1 atm it fills about 24.47 L.
  • R must match the units: 0.082057 L·atm/(mol·K) here, or 8.314 J/(mol·K) with pascals and cubic metres.
  • For a fixed amount of gas the law becomes the combined gas law, P₁V₁/T₁ = P₂V₂/T₂, handy when only the change matters.

Notes & limitations

  • Temperature must be in kelvin, not Celsius or Fahrenheit — the equation is a proportional relationship that only holds relative to absolute zero, so a Celsius value plugged in directly gives a meaningless result.
  • Real gases deviate from this law most noticeably at high pressure (where the gas particles' own volume stops being negligible) and low temperature (where intermolecular attraction stops being negligible) — the van der Waals equation is one common correction for those conditions, not covered here.

Common mistakes

  • Using degrees Celsius instead of kelvin. At 27 °C the calculation needs 300 K; entering 27 makes the volume about eleven times too small.
  • Using gauge pressure. A gauge reading of zero still means about 1 atm of absolute pressure.
  • Mixing units, for example entering pressure in psi or kPa with an R value meant for atmospheres.
  • Applying the law to a vapour close to its boiling point, or to a gas at very high pressure, where it can be badly wrong.

Frequently asked questions

What volume does one mole of gas take?

22.414 L at 0 °C and 1 atm, and about 24.47 L at 25 °C and 1 atm. Any ideal gas gives the same figure, whatever its molecules.

Why must temperature be in kelvin?

The law says volume is proportional to temperature at constant pressure, which only holds when temperature is counted from absolute zero. Going from 10 °C to 20 °C is not doubling the temperature but raising it by about 3.5%, from 283.15 K to 293.15 K.

How do I turn moles into a mass?

Multiply by the molar mass. Nitrogen, N₂, is 28.01 g per mole, so half a mole is about 14 g.

Does the type of gas matter?

Not to the ideal gas law: a mole of any ideal gas at the same pressure and temperature fills the same volume. The type matters for the mass, and for how far a real gas strays from ideal.

Further reading

PhDino earns a commission on qualifying purchases made through this link, at no extra cost to you.

Chemistry: A Very Short Introduction by Peter Atkins — A concise overview of reactions, equilibria, and gases from a leading chemistry author. (Bookshop.org UK, UK delivery only)

→ The full PhDino bookshelf on Bookshop.org (UK delivery only)

Educational tool — not a substitute for a licensed engineer or the official code text.