CalcOpenly
English

Ideal gas law calculator

Solve the ideal gas law PV = nRT for pressure, volume, moles or temperature in any units, or find a new state with the combined gas law.

Drafted with AI writing toolsUpdated Checked examples: 6

Try
Volume
L
Volume: 22.414 L
Significant figures: 6; Nearest, ties away from zero
Pressure
101.325kPa / 1atm
Amount of gas
1mol
Temperature
273.15K / 0°C
Molar volume V/n
22.414L/mol
Number of molecules
6.02214 × 10²³

1 mol of ideal gas at 273.15 K (0 °C) and 101.325 kPa occupies 22.414 L: 22.414 L per mole.

Isotherm through this state (P–V)

01002003004000204060Volume (L)Pressure (kPa)101.3 kPa, 22.41 L
How it's calculated S
  1. Convert to SI units

    P=101,325 Pa, V=0.022414 m3, n=1 mol, T=273.15 KP = 101{,}325\ \mathrm{Pa},\ V = 0.022414\ \mathrm{m^3},\ n = 1\ \mathrm{mol},\ T = 273.15\ \mathrm{K}

    Temperature is always absolute in gas laws: K = °C + 273.15.

  2. Solve PV = nRT for V

    V=nRTP=(1)(8.314462618)(273.15)101,325=0.022414 m3=22.414 LV = \frac{nRT}{P} = \frac{(1)(8.314462618)(273.15)}{101{,}325} = 0.022414\ \mathrm{m^3} = 22.414\ \mathrm{L}

About the ideal gas law calculator

The ideal gas law, PV = nRT, links the pressure, volume, amount and absolute temperature of a gas through the molar gas constant R = 8.314 462 618… J/(mol·K). Choose the unknown and enter the other three in any units; the calculator converts to pascals, cubic metres, moles and kelvin before solving. The combined gas law mode holds the amount fixed and uses P₁V₁/T₁ = P₂V₂/T₂ to find a new pressure, volume or temperature.

Students use it to find the volume of gas a reaction gives off, and engineers use it to estimate how much gas a tank holds. With the defaults, 1 mol at 0 °C and 1 atm occupies 22.414 L, the CODATA molar volume of an ideal gas at those conditions.

The law ignores molecular size and attraction. Carbon dioxide at 25 °C and 1 atm deviates from it by about 0.5 %; the calculator warns above 100 bar or below 150 K, where a van der Waals or virial equation fits better.

How to use the ideal gas law PV = nRT

PV = nRT links pressure, volume, amount and absolute temperature through R = 8.31446 J/(mol·K), using pascals, cubic meters and kelvins. One mole at 0 °C and 1 atm fills 1 × 8.31446 × 273.15 ÷ 101,325 = 0.022414 m³ (22.414 L). It fits gases at low pressure, well above their condensation point.

Solving PV = nRT step by step

  1. Convert to SI units: pressure to Pa (1 atm = 101,325 Pa, 1 bar = 100,000 Pa), volume to m³ (1 L = 0.001 m³) and temperature to kelvins (K = °C + 273.15).
  2. Rearrange for the unknown: P = nRT/V, V = nRT/P, n = PV/(RT) or T = PV/(nR).
  3. Substitute, then convert the answer to the unit you need.

Three worked cases, with more in OpenStax Chemistry §9.2:

  • Pressure: 2 mol in 10 L at 300 K gives P = 2 × 8.31446 × 300 ÷ 0.01 = 498,868 Pa, or 498.9 kPa (4.92 atm).
  • Amount: 1 m³ at 100 kPa and 25 °C holds n = 100,000 ÷ (8.31446 × 298.15) = 40.34 mol.
  • Temperature: 1 mol in 24.465 L at 1 atm sits at T = 101,325 × 0.024465 ÷ 8.31446 = 298.145 K, or 25.0 °C.

Since 2019, R has been exact at 8.31446261815324 J/(mol·K), the product of the Avogadro and Boltzmann constants. Working in liters and atmospheres instead, use R = 0.082057 L·atm/(mol·K).

Molar volume at STP: 22.414 L or 22.711 L?

One mole of ideal gas fills:

  • 22.414 L at 0 °C and 1 atm (101.325 kPa), the CODATA molar volume
  • 22.711 L at 0 °C and 1 bar (100 kPa), the standard pressure IUPAC has recommended since 1982
  • 24.465 L at 25 °C and 1 atm
  • 24.790 L at 25 °C and 1 bar

"STP" means different conditions in different books, and the two 0 °C values differ by 1.3%. Check which pressure your course or standard uses before comparing answers.

Combined gas law: P₁V₁/T₁ = P₂V₂/T₂

With the amount of gas fixed, nR is the same in both states and cancels. Holding one variable constant gives the named laws:

  • Boyle's law (constant T): P₁V₁ = P₂V₂
  • Charles's law (constant P): V₁/T₁ = V₂/T₂
  • Gay-Lussac's law (constant V): P₁/T₁ = P₂/T₂

Compress 2 L at 100 kPa and 20 °C to 150 kPa while it warms to 40 °C: V₂ = 2 × (100/150) × (313.15/293.15) = 1.4243 L. At a constant 20 °C the same compression gives 2 × 100/150 = 1.33333 L, so the warming offsets part of the squeeze.

A sealed rigid container works the same way. Taking 100 kPa at 20 °C up to 150 kPa means heating it to 293.15 × 150/100 = 439.725 K, or 166.6 °C.

Gas law examples compared

The rows are 1 mol at 0 °C and 1 atm (Default), the compression to 150 kPa and 40 °C (Combined volume) and the same compression at a constant 20 °C (Isothermal compression).

ScenarioVolume
Default22.414 L
Combined volume1.4243 L
Isothermal compression1.33333 L

From moles to molecules and mass

Multiply the amount by the Avogadro constant for the number of molecules: N = n × 6.02214076 × 10²³, so 1 mol is 6.022 × 10²³ molecules. For an atomic gas such as argon, the particles counted are atoms.

For mass, multiply n by the gas's molar mass. The 40.34 mol in 1 m³ at 100 kPa and 25 °C would weigh 1,130 g as nitrogen (N₂, 28.014 g/mol). The molar mass calculator gives M for any formula.

When real gases depart from PV = nRT

The law treats molecules as points that never attract each other (OpenStax).

Carbon dioxide at 25 °C and 1 atm already deviates by about 0.5%, and the error grows at high pressure and near condensation. Above about 100 bar or below 150 K, a van der Waals or virial equation fits real gases better.

Common mistakes

  • Gauge pressure. A tank gauge reads pressure above the atmosphere. 10 L at 200 kPa gauge and 20 °C is 301.325 kPa absolute at sea level, or 1.236 mol; the gauge figure alone gives 0.821 mol, 34% too low.
  • Celsius in the formula. 1 mol at 1 atm and 20 °C fills 24.06 L. Plugging in T = 20 gives 1.64 L, nearly 15 times too small.
  • Liters with pascals. R = 8.31446 pairs m³ with Pa, or liters with kPa; liters with Pa puts the answer off by a factor of 1,000.
  • Gas added or lost. The combined law needs a fixed amount, so a leak, a refill, a reaction or condensation between the two states breaks it.

Inputs worth checking

  • Pressure means absolute pressure, whichever of kPa, atm, bar, psi, mmHg or Pa you pick.
  • Temperatures typed in °C or °F are converted to kelvins before solving.
  • The amount can be in µmol, mmol, mol or kmol; 1,000 mmol is 1 mol.

Convert a weighed sample to moles with the grams-to-moles calculator. For heat needed to warm a material, use the heat transfer calculator.

Worked examples

1 mol at 0 °C and 1 atm

Law
PV = nRT
Solve for
Volume
Pressure P
1 atm
Amount of gas n
1
Amount unit
mol
Temperature T
0 °C
Volume
22.414 L

Checked against: CODATA 2022 molar volume of an ideal gas at 273.15 K, 101.325 kPa: 22.413 969 54 L/mol

Pressure of 2 mol in 10 L at 300 K

Law
PV = nRT
Solve for
Pressure
Volume V
10 L
Amount of gas n
2
Amount unit
mol
Temperature T
300 K
Pressure
498.868 kPa

Checked against: 2 × 8.31446261815324 × 300 / 0.01 = 498867.757 Pa

Moles in 1 m³ at 100 kPa and 25 °C

Law
PV = nRT
Solve for
Amount of gas
Pressure P
100 kPa
Volume V
1 m³
Temperature T
25 °C
Amount of gas
40.3395 mol

Checked against: 100000 / (8.31446261815324 × 298.15) = 40.3395455

Temperature of 1 mol in 24.465 L at 1 atm

Law
PV = nRT
Solve for
Temperature
Pressure P
1 atm
Volume V
24.465 L
Amount of gas n
1
Amount unit
mol
Temperature
298.145 K

Checked against: 101325 × 0.024465 / 8.31446261815324 = 298.14508 K

Questions

What is the value of R in PV = nRT?

R = 8.314 462 618 153 24 J/(mol·K), exact since the 2019 SI revision because it is the product of two fixed constants, the Avogadro constant and the Boltzmann constant. In other units it is 0.082 057 L·atm/(mol·K), 8.314 L·kPa/(mol·K) and 62.364 L·mmHg/(mol·K). Use the version that matches your pressure and volume units, or convert everything to SI as this calculator does.

What volume does one mole of gas occupy at STP?

It depends on which STP is meant. At 0 °C and 1 atm (101.325 kPa), one mole of ideal gas occupies 22.414 L; at 0 °C and 100 kPa, the standard pressure IUPAC has recommended since 1982, it occupies 22.711 L; at 25 °C and 1 atm it occupies 24.465 L. Check which definition your textbook or exam uses, since the first two differ by 1.3 %.

Why does temperature have to be in kelvin?

Gas pressure and volume are proportional to absolute temperature, which starts at absolute zero, −273.15 °C. Going from 10 °C to 20 °C looks like doubling, but the absolute temperature only rises from 283.15 K to 293.15 K, a 3.5 % increase, so at constant pressure the gas expands by 3.5 %, not 100 %. The calculator converts °C and °F to kelvin before solving.

What is the combined gas law?

P₁V₁/T₁ = P₂V₂/T₂ for a fixed amount of gas. It merges Boyle's law (PV constant at fixed temperature), Charles's law (V/T constant at fixed pressure) and Gay-Lussac's law (P/T constant at fixed volume). Heating a sealed rigid container from 20 °C to 40 °C raises 100 kPa to 106.8 kPa, because the pressure scales with 313.15 K ÷ 293.15 K.

About this calculator

PV=nRT, R=8.314 462 618… J mol−1 K−1 (exact);P1V1T1=P2V2T2PV = nRT,\ R = 8.314\,462\,618\ldots\ \mathrm{J\,mol^{-1}\,K^{-1}}\ (\text{exact});\qquad \frac{P_1V_1}{T_1} = \frac{P_2V_2}{T_2}

Sources

  1. CODATA 2022 — molar gas constant R and molar volume of an ideal gas (22.413 969 54 L/mol at 273.15 K, 101.325 kPa)
  2. OpenStax Chemistry 2e, §9.2 Relating pressure, volume, amount, and temperature: the ideal gas law

Checked against references

This calculator includes 6 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.

Put this calculator on your site

Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.

Height
Preview the embed

Keep the credit line. It is the only condition, and it is what keeps these calculators free.