SciencePhysics

Ideal Gas Law
calculator.

Know three of pressure, volume, moles and temperature, and find the fourth one.

How it's worked out

The ideal gas law ties four things together for a sample of gas: its pressure P, its volume V, its amount n in moles and its temperature T.

PV\displaystyle P V=nRT\displaystyle {}= n R T

Moving the terms around gives one formula for each unknown. Pressure must be absolute, and temperature must be in kelvin.

P\displaystyle P=nRTV\displaystyle {}= \frac{n R T}{V}
V\displaystyle V=nRTP\displaystyle {}= \frac{n R T}{P}
n\displaystyle n=PVRT\displaystyle {}= \frac{P V}{R T}
T\displaystyle T=PVnR\displaystyle {}= \frac{P V}{n R}

R is the molar gas constant. NIST lists it as exact, at 8.314462618 J/(mol·K), which goes with pascals and cubic meters. Books also print 0.08206 L·atm/(mol·K) and 8.314 L·kPa/(mol·K). They are the same constant in other units, and every input here is converted to SI first, so you never choose between them.

Mass and density need one more fact, the molar mass M: the grams in one mole of the gas. Mass is n times M, and density follows from the pressure and temperature alone.

ρ\displaystyle \rho=PMRT\displaystyle {}= \frac{P M}{R T}

Worked examples

Mia checks the volume of one mole

Mia's textbook says one mole fills about 22.4 L at 0 °C and 1 atm. With the exact R, it comes to 22.414 L, and that matches the NIST molar volume.

Her lab data sheet uses 1 bar in place of 1 atm, which is slightly lower, so the same mole spreads out to 22.711 L. At 25 °C and 1 bar it reaches 24.79 L, so she should check the conditions before she compares two figures.

Open this example in the tool

Leo weighs the air in a 1 L bottle

Leo's bottle holds 1 L at 25 °C and 1 atm. That is 0.04087 mol, or 2.5 × 10²² molecules.

At a mean molecular weight of 28.97, from NASA's Earth fact sheet, the air weighs 1.184 g, and its density is 1.184 kg/m³. An empty bottle is not really empty, then, though the weight is too small to feel.

Open this example in the tool

Dana estimates a scuba tank's pressure

Dana has 90 mol of air in an 11 L cylinder at 20 °C. The law gives 199.4 bar. Left in the sun at 40 °C, the same gas would reach 213 bar, because pressure follows the kelvin temperature.

At this pressure, the figure is an estimate. OpenStax notes that the law does not describe gases well at relatively high pressures, so a real fill calls for the gauge and the cylinder's rating, not this sum.

Open this example in the tool

Reading your result

"Standard conditions" does not mean one thing. OpenStax uses 273.15 K and 1 atm, and its footnote says IUPAC moved standard pressure to 1 bar in 1982. Here is how much that matters, with the first two lines matching the NIST values.

One mole of ideal gas under common conditions
TemperaturePressureVolume, L
0 °C1 atm22.414
0 °C1 bar22.711
25 °C1 bar24.7896
20 °C1 atm24.0551

The volume per mole depends only on the pressure and temperature, and not on which gas you have. Moles per cubic meter tell you how crowded it is: 44.62 at 0 °C and 1 atm.

Gases come closest to this law at low pressure and high temperature. Under pressure, the molecules take up real room. Close to condensing, they pull on each other. The van der Waals equation adds a correction for each, and the compressibility factor Z measures the gap: a value of 1 means the gas is behaving ideally. Take a result as rough when the tool warns of high pressure, or when the gas is near the point where it turns liquid.

Common mistakes

  • Using Celsius as if it were kelvin. At 1 atm, one mole at 25 °C fills 24.47 L. Reading 25 as kelvin gives 2.051 L, far too small. OpenStax is firm that gas laws need the kelvin scale.
  • Using gauge pressure. A tire gauge reads the pressure above the air around it. At a reading of 220 kPa, a 20 L tire at 20 °C holds 2.637 mol once you add the 101 kPa of the air outside. Skipping that step gives 1.805 mol.
  • Pairing R with the wrong units. The 8.314 form with atmospheres and liters gives an answer far from the truth. Choose units in the boxes and the conversion takes care of it.
  • Using grams as if they were moles. Divide a mass by the molar mass first, or set the molar mass and read the mass back from the answer.
  • Treating a mixture as one gas without adding the moles. For a mix, n is the total moles of everything in the container.

Questions people ask

They are for different conditions. About 22.4 L is 0 °C and 1 atm, and about 24 L is room temperature: 24.1 L at 20 °C and 1 atm. If a problem gives neither, use the full law with the stated temperature and pressure.

Sources