Maths

Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, moles or temperature, with unit conversions shown.

By Nitin Raturi · Last reviewed

Your worksheet

How to use the Ideal Gas Law Calculator

Solve PV = nRT for whichever quantity you do not know.

  1. Choose what to solve for.
  2. Enter the other three quantities.
  3. Read the answer, with conversions to atm, m³ and kelvin.

Good to know

  • Always use absolute pressure and temperature in kelvin; the tool converts °C for you.

PV = nRT. Pick the unknown; its box is ignored.

Solve for

The one quantity to work out from the other three.

How to fill it in

  • Choose pressure, volume, amount or temperature; its box is then ignored.

Pressure (kPa)

Absolute pressure of the gas.

How to fill it in

  • Enter kPa: 1 atm = 101.325 kPa, 1 bar = 100 kPa.
  • Use absolute, not gauge, pressure.

Example

0.5 mol in 2 L at 100 °C is at 775.6354 kPa.

Volume (L)

The space the gas fills.

How to fill it in

  • Enter litres: 1 m³ = 1,000 L.

Example

1 mol at 1 atm fills 22.4140 L at 0 °C and 24.4654 L at 25 °C.

Amount (mol)

How many moles of gas: mass ÷ molar mass.

How to fill it in

  • Enter moles; 32 g of oxygen (O₂) is 1 mol.

Example

10 L at 200 kPa and 27 °C holds 0.8014 mol.

Temperature (°C)

Gas temperature; converted to kelvin for the formula.

How to fill it in

  • Enter °C above −273.15.

Volume

22.4140 L

With 101.3250 kPa, 1.000000 mol, 0.00 °C, the volume is 22.4140 L.

Pressure
101.3250 kPa (1.0000 atm)
Volume
22.4140 L (0.022414 m³)
Amount
1.000000 mol
Temperature
0.00 °C (273.15 K)

Ideal gas: PV = nRT with R = 8.314 462 618 J/(mol·K). Real gases depart from this at high pressure and low temperature. 1 atm = 101.325 kPa.

How this calculator works

  1. Step 1Chooseone unknownPressure, volume, amount or temperature.
  2. Step 2Convert°C + 273.15Temperature must be in kelvin.
  3. Step 3RearrangePV = nRTkPa × L gives joules directly.

The ideal gas law links a gas’s pressure, volume, amount and temperature. Knowing any three gives the fourth.

R is the molar gas constant, 8.314 462 618 J/(mol·K), exact in today’s SI units because it is the Avogadro constant times the Boltzmann constant.

Worked example: molar volume at 0 °C

Volume of 1 mol at 101.325 kPa and 0 °C
V
n R T ÷ P
  1. Temperature0 + 273.15273.15 K
  2. n R T1 × 8.3145 × 273.152,271.10 J
  3. Volume2,271.10 ÷ 101.32522.4140 L

Read the result

  • 0 °C22.4140 LThe classic 22.4 L per mole.
  • 25 °C24.4654 LWarmer gas expands in proportion to kelvin.

Heated gas in a closed container builds pressure: 0.5 mol in 2 L at 100 °C reaches 775.6354 kPa. A 10 L tank at 200 kPa and 27 °C holds 0.8014 mol.

Assumptions and limits

  • Low pressureBest near atmospheric pressure.
  • Warm gasesFails near condensation.
  • Absolute unitsAbsolute pressure, kelvin temperature.
  • No mixtures rulen is the total moles of all gases.

The gas law needs moles. Molar mass and solution strength are the neighbouring sums.

To turn grams of a gas into moles, use the molecular weight calculator. For solutions, try the molarity calculator, and for heat to warm a substance, the specific heat calculator.

Common mistakes

  • Mistake: Using °C in the formula.

    Instead: Add 273.15 for kelvin; the tool does this.

  • Mistake: Using gauge pressure from a tyre gauge.

    Instead: Add atmospheric pressure (about 101 kPa).

  • Mistake: Mixing kPa with m³.

    Instead: kPa with litres, or Pa with m³.

Checking the method

A separate script solves every case molecule by molecule, PV = NkT with the Boltzmann constant, in exact fractions.

Read how we test our calculators, or browse more maths calculators.

Frequently asked questions

What volume does 1 mol of gas take at 0 °C and 1 atm?

22.4140 L, from V = nRT ÷ P.

And at 25 °C?

24.4654 L: volume grows in proportion to kelvin temperature.

What value of R does it use?

R = 8.314 462 618 J/(mol·K), exact in the SI since 2019.

How much gas is in a 10 L tank at 200 kPa and 27 °C?

n = PV ÷ RT = 0.8014 mol of gas.

What pressure does 0.5 mol in 2 L at 100 °C reach?

P = nRT ÷ V = 775.6354 kPa, more than seven times atmospheric pressure.

Sources and methodology

The formulas are standard time-value-of-money results. We check every figure against golden values worked out independently, by closed form and by month-by-month simulation; see the methodology.

Written and maintained by Nitin Raturi, a software engineer (about the author). Last reviewed 4 Nov 2026; next review due by . Found an error? Tell us.

Changelog

  • : Initial release.