Gas Law Calculator

Solve PV = nRT for pressure, volume, moles, or temperature.

Chemistry and LabUpdated 2026-10-102 min read
Gas Law Calculator
Answer
...
Form used...

What it does

The ideal gas law ties the four measurable gas variables into one equation: pressure times volume equals moles times R times absolute temperature. Fix any three and the fourth follows by rearrangement.

The tool above solves for whichever variable you pick. Enter the other three in kPa, liters, moles, and kelvin; R runs fixed at 8.314 L·kPa per mol per K.

The default solves pressure for 1 mol in 22.71 L at 273.15 K: exactly 100 kPa, the modern STP definition point. The same inputs rearranged give 22.71 L, 1 mol, or 273.2 K in the other modes.

R follows the NIST CODATA exact value with the same classroom rearrangements in OpenStax Chemistry. Both use kelvin throughout, since Celsius offsets break the proportionality.

How to use

  1. Pick which variable to solve for first.
  2. Enter the other three values in the shown units.
  3. Convert any Celsius to kelvin before entering.
  4. Read the answer with the rearranged form beside it.
  5. Flip modes to cross check the same state.

Formula

PV = nRT. P = nRT/V. V = nRT/P. n = PV/RT. T = PV/nR. R 8.314 L·kPa/mol/K.
P / V
Kilopascals and liters of the gas state.
n / T
Moles and absolute kelvin.
R
8.314 L·kPa per mol per K, exact.

Ideal behavior assumed: point particles with no forces. High pressures and near condensation need van der Waals corrections outside this page.

Worked example

Example: 1 mol, 22.71 L, 273.15 K

Solve pressure with defaults.

  1. nRT: 1 x 8.314 x 273.15 = 2270.97.
  2. Divide: 2270.97 / 22.71 = 100.00.
  3. Result: 100 kPa, the STP definition pressure.
  4. Reverse: 100 x 22.71 / (8.314 x 273.15) = 1 mol back.
  5. Tool shows 100 kPa, P = nRT / V.

Reference table

R in common unit pairs
UnitsR valueUse with
L·kPa / mol / K8.314This page
L·atm / mol / K0.08206Atmosphere work
L·torr / mol / K62.36Vacuum gauges
J / mol / K8.314Energy form

Limits

  • Ideal gas only; dense and cold gases deviate.
  • Kelvin required; Celsius entries corrupt answers.
  • Single pure gas assumed; mixes need partial pressures.
  • Reactions changing moles need stoichiometry beside it.

Common mistakes

  • Entering Celsius instead of kelvin.
  • Mixing atm pressures with the 8.314 R.
  • Using milliliters with liter based R.
  • Solving for T and reporting Celsius directly.
  • Applying ideal math inside condensation ranges.

Try it yourself

Quick checks. Answers sit tucked under each question.

V for 2 mol at 100 kPa, 273.15 K?

2 x 8.314 x 273.15 / 100 = 45.42 L.

n at 100 kPa, 22.71 L, 273.15 K?

100 x 22.71 / (8.314 x 273.15) = 1 mol.

T for 1 mol, 100 kPa, 22.71 L?

100 x 22.71 / 8.314 = 273.2 K.

Questions

What is PV = nRT?

The ideal gas law: pressure times volume equals moles times R times kelvin.

What is R?

8.314 L·kPa per mol per K (exact). Other unit pairs use 0.08206 or 62.36.

Why kelvin?

Gas laws scale with absolute temperature. 0 C is 273.15 K, and ratios need that base.

What is STP?

273.15 K and 100 kPa modern definition, where 1 mol fills 22.71 L.

When does it fail?

High pressure, low temperature, and polar gases deviate toward van der Waals behavior.

How do gas mixes work?

Each gas follows its partial pressure; sum them for the total (Dalton law).

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.