March 26, 20263 min read

Ideal Gas Law Calculator — PV = nRT

Calculate pressure, volume, temperature, or moles using the ideal gas law PV = nRT. Covers gas constant, STP conditions, Boyle's and Charles's laws.

ideal gas law thermodynamics PV=nRT pressure calchub
Ad 336x280

The ideal gas law unifies several separate gas laws — Boyle's, Charles's, Gay-Lussac's — into a single relationship. Four variables, one equation. Change any one and you can calculate the effect on the others. It's an approximation (real gases deviate, especially at high pressure or low temperature), but for most everyday gas problems it's remarkably accurate.

The CalcHub ideal gas law calculator solves for pressure, volume, temperature, or moles of gas from the other three inputs.

The Formula

PV = nRT
  • P = absolute pressure (Pascals, Pa, or atm)
  • V = volume (m³ or liters)
  • n = amount of substance (moles)
  • R = universal gas constant = 8.314 J/(mol·K)
  • T = absolute temperature (Kelvin — MUST use Kelvin, not Celsius)
Converting to Kelvin: T(K) = T(°C) + 273.15

Special Cases (Derived Laws)

LawHeld constantRelationship
Boyle'sT and nPV = constant
Charles'sP and nV/T = constant
Gay-Lussac'sV and nP/T = constant
Avogadro'sP and TV/n = constant

Standard Conditions

StandardTP
STP (IUPAC)0°C (273.15 K)100 kPa
Old STP0°C (273.15 K)101.325 kPa
NTP20°C (293.15 K)101.325 kPa
At STP, one mole of ideal gas occupies 22.414 liters.

Worked Example

A sealed container holds 0.5 mol of nitrogen at 25°C (298.15 K) in a 12-liter (0.012 m³) volume. What is the pressure?

P = nRT/V = (0.5 × 8.314 × 298.15) / 0.012
= 1239.2 / 0.012
= 103,267 Pa ≈ 1.02 atm

Just slightly above atmospheric — makes sense for a nearly ambient-temperature gas container.


When does the ideal gas law fail?

At high pressures (compressed gas cylinders) and low temperatures (near condensation), real gas molecules interact with each other and take up significant volume. The van der Waals equation corrects for these effects. For most air/gas problems below 10 atm and above −50°C, the ideal gas law is within a few percent.

Why must I use Kelvin?

Because the law is based on absolute temperature (related to average molecular kinetic energy). 0°C is 273 K — molecules still have kinetic energy. 0 K is absolute zero where molecular motion theoretically stops. Using Celsius would give nonsensical results at low temperatures.

How do I find molar mass using this?

Combine PV = nRT with n = m/M (mass/molar mass): M = mRT/(PV). This is how chemists determine unknown gas molar masses from measurable density.


Ad 728x90