Ideal Gas Law Calculator Formula

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

Formulas Used

Pressure (P)

pressure = (n * 0.08206 * temp) / volume

Pressure

pressure_kpa = ((n * 0.08206 * temp) / volume) * 101.325

Variables

VariableDescriptionDefault
nAmount of Gas (n)(mol)1
tempTemperature (T)(K)273.15
volumeVolume (V)(L)22.414

How It Works

Ideal Gas Law

Formula

PV = nRT

Solving for P: P = nRT / V

Where:

  • P = pressure (atm)
  • V = volume (L)
  • n = moles of gas
  • R = gas constant = 0.08206 L·atm/(mol·K)
  • T = temperature (K)
  • The ideal gas law assumes no intermolecular forces and negligible molecular volume.

    Worked Example

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

    n = 1temp = 273.15volume = 22.414
    1. 01P = nRT / V
    2. 02P = (1)(0.08206)(273.15) / 22.414
    3. 03P = 22.414 / 22.414
    4. 04P = 1.000 atm

    Frequently Asked Questions

    When does the ideal gas law apply?

    It works well at low pressures and high temperatures where gas molecules are far apart. It becomes inaccurate near condensation or at very high pressures.

    What value of R should I use?

    R = 0.08206 L·atm/(mol·K) for pressure in atm and volume in liters. R = 8.314 J/(mol·K) for SI units.

    How do I convert Celsius to Kelvin?

    Add 273.15. For example, 25°C = 298.15 K. Temperature in the ideal gas law must be in Kelvin.

    Learn More

    Guide

    How to Use the Ideal Gas Law

    Learn how to use the ideal gas law PV = nRT step by step. Covers pressure, volume, temperature, moles, the gas constant, and related gas laws with worked examples.

    Ready to run the numbers?

    Open Ideal Gas Law Calculator