Ideal Gas Law Calculator (PV = nRT)

Solve for pressure, volume, moles or temperature — with full unit conversion.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

The ideal gas law calculator solves PV = nRT for any one of the four state variables — pressure (P), volume (V), amount of substance (n) or temperature (T) — given the other three. It covers eight pressure units (Pa, kPa, MPa, bar, atm, psi, mmHg, torr), five volume units (m³, L, mL, cm³, ft³), three temperature scales (Kelvin, Celsius, Fahrenheit) and three molar units (mol, mmol, kmol), converting everything to SI internally before applying the formula and converting back to your preferred output unit.

The formula

The ideal gas law is:

PV = nRT

where each variable has a precise meaning:

  • P — absolute pressure, in Pascals (Pa) internally
  • V — volume, in cubic metres (m³) internally
  • n — amount of gas, in moles (mol)
  • T — absolute temperature, in Kelvin (K); subtract 273.15 from a Celsius reading to convert
  • R — the universal gas constant, 8.314 462 618 J/(mol·K) (2018 NIST CODATA value)

Rearranging gives four solving forms:

Solving forFormula
PressureP = nRT / V
VolumeV = nRT / P
Molesn = PV / (RT)
TemperatureT = PV / (nR)

The calculator uses whichever row matches your selection, with all inputs converted to SI before the arithmetic and the result converted back to your chosen display unit.

How it works

Every input passes through an exact unit-conversion factor to Pascals (or m³, mol, or K). The four rearrangements are then simple one-line divisions. The result is converted from SI to the output unit you select independently, so you can, for example, enter pressure in atm, volume in litres and temperature in Celsius, then read the mole count directly. The “Show working” panel displays all four SI values so you can verify the arithmetic step by step.

The gas constant used is R = k × N_A = 1.380 649 × 10⁻²³ × 6.022 140 76 × 10²³ = 8.314 462 618 J/(mol·K), which is the exact value implied by the 2019 SI redefinition.

Worked example

Problem: A sealed 5-litre flask contains 0.25 mol of nitrogen gas at 20 °C. What is the pressure in atm?

Step 1 — convert to SI:

  • V = 5 L = 0.005 m³
  • n = 0.25 mol
  • T = 20 °C = 293.15 K

Step 2 — apply P = nRT / V:

  • P = (0.25)(8.314 462 618)(293.15) / 0.005
  • P = (0.25 × 2438.0) / 0.005
  • P = 609.5 / 0.005
  • P = 121 900 Pa

Step 3 — convert to atm: 121 900 / 101 325 = 1.203 atm

So the flask holds approximately 1.2 atmospheres — slightly above standard atmospheric pressure, which is typical for a gas stored at room temperature.

Common reference points

ConditionPV per mol
IUPAC STP (0 °C, 1 bar)100 kPa22.711 L
Old STP (0 °C, 1 atm)101.325 kPa22.414 L
Room temperature (25 °C, 1 atm)101.325 kPa24.465 L
Body temperature (37 °C, 1 atm)101.325 kPa25.447 L

All calculations run entirely in your browser — no data is ever uploaded or stored.

Ad placeholder (rectangle)