Ideal Gas Law Calculator Formula

Understand the math behind the ideal gas law calculator. Each variable explained with a worked example.

Formulas Used

Pressure

pressure_atm = moles * 0.082057 * temperature / volume

Pressure (Pa)

pressure_pa = moles * 8.314 * temperature / (volume * 0.001)

Variables

VariableDescriptionDefault
molesAmount of Gas (n)(mol)1
temperatureTemperature(K)273.15
volumeVolume(L)22.414

How It Works

Ideal Gas Law

The ideal gas law relates the pressure, volume, temperature, and amount of a gas.

Formula

PV = nRT

where R = 0.082057 L·atm/(mol·K) or 8.314 J/(mol·K). This law is accurate for gases at moderate pressures and temperatures.

Worked Example

1 mole of gas at 273.15 K (0°C) in 22.414 L (STP conditions).

moles = 1temperature = 273.15volume = 22.414
  1. 01P = nRT / V
  2. 02P = 1 * 0.082057 * 273.15 / 22.414
  3. 03P = 22.414 / 22.414
  4. 04P = 1.000 atm (as expected at STP)

Ready to run the numbers?

Open Ideal Gas Law Calculator