Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, moles or temperature, with unit conversion and a check on how ideal the conditions really are.

How to use this calculator

  1. 1Choose which of the four variables you want to find — the input for it disappears.
  2. 2Enter the other three, each with its own unit; the calculator converts everything to SI internally.
  3. 3Check the note about how ideal the conditions are: at high pressure or low temperature the answer becomes an approximation rather than a good model.

How the calculation works

PV = nRT
P
Absolute pressure, in pascals internally
V
Volume, in cubic metres internally
n
Amount of substance, in moles
R
Molar gas constant, exactly 8.31446261815324 J/(mol·K)
T
Absolute temperature, in kelvin — never Celsius or Fahrenheit

Rearranged for each unknown: P = nRT/V, V = nRT/P, n = PV/RT, T = PV/nR.

R is exact rather than measured. Since the 2019 SI redefinition fixed both the Boltzmann constant and the Avogadro constant at defined values, R = N_A · k_B is exact by construction, with no remaining experimental uncertainty.

Temperature must be absolute. Using Celsius directly is the single most common error with this equation — at 0 °C it would make the entire right-hand side zero, implying zero pressure. This calculator converts to kelvin internally whichever scale you enter.

Worked example

How many moles in 22.414 L at 1 atm and 0 °C?

  1. 1.Convert to SI: P = 1 atm = 101,325 Pa; V = 22.414 L = 0.022414 m³; T = 0 °C = 273.15 K.
  2. 2.n = PV / RT = (101,325 × 0.022414) ÷ (8.31446261815324 × 273.15).
  3. 3.Numerator: 101,325 × 0.022414 = 2,271.0986 J. Denominator: 8.31446261815324 × 273.15 = 2,271.0955 J/mol.
  4. 4.n = 1.0000 mol — the last digits differ only because 22.414 L is itself a rounded figure, which is a good check that the constants line up.

Result: 1.000 mol

One equation from four gas laws

The ideal gas law is a consolidation of several relationships discovered separately over about two centuries. Boyle found that pressure and volume are inversely related at fixed temperature; Charles that volume rises in proportion to absolute temperature at fixed pressure; Gay-Lussac the same for pressure; and Avogadro that equal volumes of gas at the same temperature and pressure contain equal numbers of molecules. PV = nRT is what you get when all four are combined into a single statement, with R as the constant that makes the units work.

What makes it remarkable is that R is the same for every gas. Helium, nitrogen and carbon dioxide all follow the same equation with the same constant, because under ideal conditions the identity of the molecules simply does not enter into it — only how many there are.

The assumptions behind "ideal"

The law is exact for a hypothetical gas with two properties no real gas quite has.

  • Molecules occupy no volumethey are treated as point particles. In a real gas the molecules themselves take up space, so the volume available to move in is slightly less than the container volume — which matters once the gas is compressed enough that molecular volume is a meaningful fraction of the total.
  • No intermolecular forcescollisions are perfectly elastic and molecules neither attract nor repel each other between collisions. Real molecules do attract, which slightly reduces the pressure they exert on the walls — an effect that grows as they slow down at low temperature.

When real gases stop cooperating

Both assumptions fail in the same two regimes: high pressure and low temperature. Compress a gas enough and the molecules' own volume becomes non-negligible, making the real volume larger than the ideal law predicts. Cool it enough and attractive forces start to dominate, making the real pressure lower than predicted — and eventually the gas condenses into a liquid, at which point the equation does not apply at all.

Near room temperature and around atmospheric pressure, most common gases follow the ideal law to within about 1%, which is why it is the right tool for the overwhelming majority of everyday and introductory calculations. When it is not good enough, the van der Waals equation adds two empirical correction terms — one for molecular volume, one for attraction — with constants specific to each gas, giving up the universality of R in exchange for accuracy.

STP, molar volume, and a note on standards

The molar volume of an ideal gas — the space one mole occupies — depends entirely on the conditions, which is why "standard" conditions have to be specified. At 0 °C and 1 atm the figure is the familiar 22.414 L/mol. IUPAC, however, has defined standard pressure as 100 kPa (1 bar) rather than 1 atm since 1982, which gives 22.711 L/mol at the same temperature. Both numbers are correct for their own definition, and textbooks differ on which they use.

This is worth checking before comparing a calculated result against a published one: a 1.3% discrepancy in molar volume usually means the two sources are using different standard pressures, not that either is wrong.

What this assumes, and where it stops

Assumptions

  • The gas behaves ideally — point-like molecules with no intermolecular forces. Accurate to roughly 1% for common gases near ambient conditions.
  • Pressure is absolute, not gauge. A tyre gauge reading must have atmospheric pressure added before it is used here.
  • Temperature is converted to kelvin internally regardless of the scale entered, since the law requires absolute temperature.

Limitations

  • Accuracy degrades at high pressure (above roughly 10 atm) and low temperature, where real-gas behaviour diverges. The van der Waals or Redlich–Kwong equations are better in those regimes.
  • Does not apply at all to liquids, solids, or gases at or below their condensation point.
  • Assumes a single pure gas or an ideal mixture. For gas mixtures, the law applies to the total moles; individual partial pressures need Dalton's law.

Common questions

Why must temperature be in kelvin?

Because the law describes proportionality to absolute temperature, and only kelvin has its zero at absolute zero. Using Celsius breaks it immediately: at 0 °C the right-hand side would become zero, implying a gas at freezing point exerts no pressure at all. This calculator accepts any scale and converts internally, but a hand calculation must convert first.

What is the value of R, and why does it vary between textbooks?

R is exactly 8.31446261815324 J/(mol·K) in SI units, fixed by the 2019 SI redefinition. It appears different in other unit systems — 0.082057 L·atm/(mol·K) is the same constant expressed for pressure in atmospheres and volume in litres. The physical constant is identical; only the units differ.

When is the ideal gas law not good enough?

At high pressure and low temperature. Around ambient conditions most gases follow it to within about 1%. Compressed gas cylinders, cryogenic work, and anything near a gas's condensation point all need a real-gas equation such as van der Waals instead.

Sources

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the ideal gas law calculator.

See all science & engineering calculators →