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)

Frequently Asked Questions

What is an ideal gas?

A theoretical gas with perfectly elastic collisions and no intermolecular forces. Real gases approximate ideal behavior at low pressures and high temperatures.

What is STP?

Standard Temperature and Pressure: 273.15 K (0°C) and 1 atm. At STP, one mole of ideal gas occupies 22.414 liters.

When does the ideal gas law fail?

At very high pressures or low temperatures, where intermolecular forces and molecular volumes become significant. The van der Waals equation corrects for this.

Learn More

Guide

How to Calculate Density

Learn how to calculate density using the formula density = mass / volume. Covers units, measurement techniques, buoyancy, and real-world applications with worked examples.

Ready to run the numbers?

Open Ideal Gas Law Calculator