Ideal Gas Law Calculator (PV = nRT)

Solve PV = nRT for any unknown.

Science Solve for P, V, n, T Auto unit display Validates T ≥ 0 K
Rate this calculator · 4.0 (1)

PV = nRT solver

R = 0.082057 L·atm/(mol·K)

Instructions — Ideal Gas Law Calculator (PV = nRT)

  1. Pick which variable you want to solve for: P, V, n, or T.
  2. Enter the three remaining values.
  3. Read the result with full unit cross-display (K, °C, °F for temperature).

The calculator uses R = 0.082057 L·atm/(mol·K). Temperature must be in Kelvin. To use Celsius, add 273.15 before entering.

Formulas

PV = nRT
  • P = pressure (atm)
  • V = volume (L)
  • n = moles of gas
  • R = 0.082057 L·atm/(mol·K)
  • T = absolute temperature (K)

Solved forms

  • P = nRT / V
  • V = nRT / P
  • n = PV / (RT)
  • T = PV / (nR)

Temperature conversion

T(K) = T(°C) + 273.15
T(K) = (T(°F) + 459.67) × 5/9

Standard conditions (STP, IUPAC 2019)

1 bar (≈ 0.987 atm), 273.15 K. One mole of an ideal gas occupies 22.711 L at this STP. The legacy STP (1 atm, 273.15 K) gives the more familiar 22.414 L/mol.

Reference

Gas constant R

ValueUnitsUse
0.082057L·atm/(mol·K)Lab default
8.314J/(mol·K)SI
0.08314L·bar/(mol·K)European
62.364L·mmHg/(mol·K)Older texts

Standard conditions

StandardPTV/mol
STP (IUPAC 2019)1 bar273.15 K22.711 L
STP (legacy)1 atm273.15 K22.414 L
NTP1 atm293.15 K24.06 L
SATP1 bar298.15 K24.79 L

Article — Ideal Gas Law Calculator (PV = nRT)

Ideal gas law calculator (PV = nRT)

The ideal gas law is PV = nRT. Pressure times volume equals moles times the gas constant times absolute temperature. With three of the four variables, you can solve for the fourth — pressure, volume, moles, or temperature — using R = 0.082057 L·atm/(mol·K).

This single equation, derived from the work of Boyle, Charles, Gay-Lussac, and Avogadro between 1662 and 1811, describes how nearly every gas behaves under typical lab and industrial conditions. It underpins balloon physics, scuba diving math, the volumes used in stoichiometry, and the calibration of industrial gas tanks.

What is the ideal gas law?

The ideal gas law is an equation of state that relates pressure, volume, amount, and temperature of a gas assumed to consist of non-interacting point particles. It is exact for a hypothetical ideal gas and accurate to within about 1 percent for real gases at moderate conditions: pressures below 10 atm and temperatures well above the boiling point.

Three of the variables are intensive properties of the gas state (P, V, T) while n captures how much gas you have. Together they fully specify a gas sample. Know any three and the fourth is determined.

Did you know

The ideal gas law was first written in its modern form by Émile Clapeyron in 1834, combining Boyle's law (1662), Charles's law (1787), and Avogadro's law (1811). The universal gas constant R wasn't given that exact name until the late 19th century.

The ideal gas law formula explained

PV = nRT looks simple but every symbol carries baggage. P is pressure in any consistent unit — atm, kPa, bar, or Pa, depending on the matching R. V is the volume occupied by the entire gas sample, not the molar volume. n is the amount in moles, where one mole equals 6.022 × 10²³ molecules.

Solved forms of PV = nRT
P = nRT / V
V = nRT / P
n = PV / (RT)
T = PV / (nR)

R is the constant tying it all together. In L·atm/(mol·K) units it equals 0.082057. T is absolute temperature in Kelvin — never Celsius, never Fahrenheit. This is the single most common source of error.

Solving PV = nRT for any variable

Worked example: 2 moles of nitrogen gas occupy a 10 L container at 300 K. What is the pressure?

P = nRT / V = (2 × 0.082057 × 300) / 10 = 4.92 atm. Pretty close to five atmospheres, well within the ideal regime.

Reverse the problem: you have nitrogen at 4.92 atm and 300 K in a 10 L tank. How many moles? n = PV / (RT) = (4.92 × 10) / (0.082057 × 300) = 2.0 moles. The math is symmetric — pick the unknown and isolate it.

The gas constant R and unit pairing

R is the conversion factor between pressure-volume energy and temperature-mole energy. It has the same numerical meaning regardless of unit system, but the digits change depending on units. Mismatched units are the second-most-common ideal gas law mistake.

  • 0.082057 L·atm/(mol·K) — pair with atm and L.
  • 8.314 J/(mol·K) — pair with Pa and m³.
  • 0.08314 L·bar/(mol·K) — pair with bar and L.
  • 62.364 L·mmHg/(mol·K) — pair with mmHg and L.
  • 10.731 psi·ft³/(lbmol·°R) — pair with psi and ft³ (US engineering).
! Unit pairing trap

Using P in kPa with R = 0.082057 (which expects atm) gives an answer off by a factor of ~101. Always sanity-check the order of magnitude. If your gas mole count comes out around 100 or 0.01, you probably mismatched units.

Ideal gas law at STP

STP, Standard Temperature and Pressure, is a reference state used to compare gas volumes. The current IUPAC definition (since 1982) is 1 bar pressure and 273.15 K. Under those conditions one mole of an ideal gas occupies 22.711 liters.

STP (legacy)
22.414 L/mol
1 atm, 273.15 K
STP (modern)
22.711 L/mol
1 bar, 273.15 K
SATP (room)
24.79 L/mol
1 bar, 298.15 K

The 22.4 L/mol figure that appears in older textbooks uses 1 atm rather than 1 bar. The difference is small — about 1.3 percent — but matters in precision work. Check which STP your problem is using.

Boyle's, Charles's, and Gay-Lussac's laws

Three special cases of PV = nRT show up constantly in physics and chemistry, each holding one set of variables constant.

  • Boyle's law (constant T, n): P₁V₁ = P₂V₂. Squeeze a balloon, pressure rises.
  • Charles's law (constant P, n): V₁/T₁ = V₂/T₂. Heat a balloon, it expands.
  • Gay-Lussac's law (constant V, n): P₁/T₁ = P₂/T₂. Heat a sealed tank, pressure rises.
  • Avogadro's law (constant P, T): V₁/n₁ = V₂/n₂. More gas, more volume.
  • Combined gas law: P₁V₁/T₁ = P₂V₂/T₂. Rolls Boyle, Charles, and Gay-Lussac into one.
Tip

If a problem describes a gas changing state (heated, compressed, expanded) and the amount stays fixed, the combined gas law P₁V₁/T₁ = P₂V₂/T₂ is usually faster than computing PV = nRT twice.

When the ideal gas law fails

The two assumptions — point particles, no intermolecular forces — break down when molecules are close enough to interact. Three conditions push gas behavior away from ideal: high pressure, low temperature, and polar molecules like water vapor, ammonia, or carbon dioxide.

At 100 atm and room temperature, CO₂ deviates from ideal by about 5 percent. At 0 °C and 1 atm, water vapor deviates by similar amounts. For accurate work in these regimes, the van der Waals equation adds two correction terms for molecular volume and intermolecular attraction.

Common ideal gas law mistakes

Three errors account for most wrong answers on chemistry exams. First, leaving temperature in Celsius — this can throw results off by a factor of 10 or more. Second, mismatching the R value with the pressure unit. Third, using volume in mL or m³ when R expects liters; 500 mL is 0.5 L, not 500.

A quick sanity check: a mole of any gas at room temperature and 1 atm occupies about 24.5 liters. If your answer is wildly different from a multiple of that, recheck units before submitting.

One more subtle trap is the assumption that PV = nRT works for gas mixtures. It does, but only if you treat each gas separately using Dalton's law of partial pressures. The total pressure equals the sum of partial pressures, and each component obeys its own PV = nRT with the shared total volume and temperature.

FAQ

PV = nRT, where P is pressure, V is volume, n is moles, R is the gas constant (0.082057 L·atm/mol·K when using atm and liters), and T is absolute temperature in Kelvin. Rearrange to solve for any unknown variable.
The law treats temperature as proportional to molecular kinetic energy, which is zero only at absolute zero. Celsius and Fahrenheit have arbitrary zero points, so they break the proportionality. Always convert: K = °C + 273.15.
STP stands for Standard Temperature and Pressure. The 2019 IUPAC definition is 1 bar and 273.15 K, giving 22.711 L per mole. The pre-1982 IUPAC convention used 1 atm and 273.15 K, giving the textbook 22.414 L/mol.
Use R = 0.082057 L·atm/(mol·K) when pressure is in atmospheres and volume in liters. Use R = 8.314 J/(mol·K) for SI calculations with pressure in pascals and volume in cubic meters. The R value must match your chosen units.
It overestimates pressure and volume at high pressure (above ~10 atm) or low temperature (near condensation point). Real gases interact and have finite molecular volume. Use the van der Waals equation in those regimes.
Rearrange to n = PV / (RT). Example: 1 atm pressure, 22.4 L volume, 273.15 K temperature gives n = (1 × 22.4) / (0.082057 × 273.15) = 1.00 mol.