PV = nRT
Last reviewed: January 2026
An ideal gas law calculator solves PV = nRT for any missing variable — pressure, volume, moles, or temperature. It is a fundamental tool for chemistry and physics students studying gas behavior under different conditions.
The ideal gas law is the most important equation in introductory chemistry and thermodynamics. It relates four properties of a gas — pressure (P), volume (V), amount (n), and temperature (T) — through the universal gas constant (R). Given any three variables, you can solve for the fourth. It works well for most gases at moderate temperatures and pressures (conditions where gas molecules don't interact significantly with each other).
P (Pressure): Force per unit area. Common units: atm, kPa, mmHg (torr), psi. 1 atm = 101.325 kPa = 760 mmHg = 14.696 psi. V (Volume): Space the gas occupies. Usually in liters (L). n (Moles): Amount of gas in moles. 1 mole = 6.022 × 10²³ molecules (Avogadro's number). T (Temperature): Must be in Kelvin (K = °C + 273.15). Using Celsius or Fahrenheit gives wrong answers. R (Gas constant): 0.08206 L⋅atm/(mol⋅K) or 8.314 J/(mol⋅K) depending on pressure units.
STP (Standard Temperature and Pressure): 0°C (273.15 K) and 1 atm. At STP, 1 mole of ideal gas occupies 22.414 liters — a useful benchmark. Standard Ambient: 25°C (298.15 K) and 1 atm. At these conditions, 1 mole occupies about 24.47 liters. Many chemistry problems use STP conditions, so memorizing 22.4 L/mol saves calculation time.
Find volume: 2 moles of gas at 1 atm and 300 K. V = nRT/P = 2 × 0.08206 × 300 / 1 = 49.24 L. Find pressure: 0.5 mol in a 10 L container at 400 K. P = nRT/V = 0.5 × 0.08206 × 400 / 10 = 1.64 atm. Find temperature: 3 mol at 2 atm in 50 L. T = PV/nR = 2 × 50 / (3 × 0.08206) = 406 K (133°C).
Real gases deviate from ideal behavior at high pressures (molecules forced close together, intermolecular forces matter) and low temperatures (molecules move slowly, attractions become significant). For these conditions, use the Van der Waals equation: (P + an²/V²)(V − nb) = nRT, which adds correction factors for molecular attraction (a) and volume (b). Noble gases (He, Ne, Ar) behave most ideally. Polar molecules (H₂O, NH₃) deviate most.
The ideal gas law unifies several earlier discoveries: Boyle's Law: P₁V₁ = P₂V₂ (constant T, n). Charles's Law: V₁/T₁ = V₂/T₂ (constant P, n). Avogadro's Law: V₁/n₁ = V₂/n₂ (constant T, P). Gay-Lussac's Law: P₁/T₁ = P₂/T₂ (constant V, n). These are all special cases of PV = nRT with certain variables held constant.
| Variable | Symbol | SI Unit | Other Common Units |
|---|---|---|---|
| Pressure | P | Pascals (Pa) | atm, mmHg, psi |
| Volume | V | Cubic meters (m³) | Liters (L) |
| Amount | n | Moles (mol) | — |
| Temperature | T | Kelvin (K) | °C + 273.15 |
| Gas constant | R | 8.314 J/(mol·K) | 0.08206 L·atm/(mol·K) |
The ideal gas law (PV = nRT) unifies four gas laws discovered independently over two centuries into a single equation. P is pressure (in atmospheres, pascals, or other units), V is volume (in liters or cubic meters), n is the amount of gas (in moles), R is the universal gas constant (0.0821 L·atm/(mol·K) or 8.314 J/(mol·K)), and T is absolute temperature (in Kelvin — never Celsius or Fahrenheit in gas law calculations). This equation describes the behavior of an "ideal gas" — a theoretical gas whose molecules occupy no volume and exert no intermolecular forces. Real gases approximate ideal behavior at high temperatures and low pressures, where molecules are far apart and moving fast enough that their size and attractions are negligible.
Each variable relationship within PV = nRT has a named law. Boyle's Law (P₁V₁ = P₂V₂ at constant n and T) states that pressure and volume are inversely proportional — compressing a gas to half its volume doubles its pressure. Charles's Law (V₁/T₁ = V₂/T₂ at constant n and P) states that volume is directly proportional to absolute temperature — heating a gas causes it to expand. Gay-Lussac's Law (P₁/T₁ = P₂/T₂ at constant n and V) states that pressure is directly proportional to temperature — heating a sealed container increases the pressure. Avogadro's Law (V₁/n₁ = V₂/n₂ at constant P and T) states that equal volumes of gases at the same temperature and pressure contain equal numbers of molecules. The ideal gas law combines all four into one powerful equation.
Automotive engines rely on gas law principles. During the compression stroke, the piston reduces the cylinder volume by a factor of 8-12 (the compression ratio), increasing both pressure and temperature according to the combined gas law. This compressed, heated air-fuel mixture ignites more efficiently than uncompressed mixture, which is why higher compression ratios generally produce more power and better fuel efficiency. Turbocharged engines force additional air (more moles of gas) into the same cylinder volume, increasing n in PV = nRT and therefore increasing pressure and power output. Intercoolers cool the compressed air before it enters the cylinders, reducing T to prevent pre-ignition (knocking) and allow even more air mass to fit in the cylinder.
Weather forecasting uses gas law principles to model atmospheric behavior. Air pressure decreases with altitude because there is less air above to compress the air below — this pressure gradient follows a modified gas law that accounts for gravity and temperature variation with height. When air rises (due to heating, terrain forcing, or frontal lifting), it expands into lower-pressure surroundings and cools adiabatically at approximately 9.8°C per 1,000 meters of altitude gain. If the air is humid enough, this cooling causes water vapor to condense into clouds when the temperature reaches the dew point. The entire process — from surface heating to cloud formation to precipitation — is governed by the gas law relationships between pressure, volume, temperature, and the moisture-carrying capacity of air.
Real gases deviate from ideal behavior most significantly at high pressures (where molecules are forced close together and their finite volume matters) and low temperatures (where intermolecular attractions become significant relative to kinetic energy). The Van der Waals equation (P + a/V²)(V − b) = nRT corrects for both effects: the term a/V² accounts for intermolecular attractions that reduce the effective pressure (molecules are pulled inward by neighbors instead of hitting the container wall as hard), and the term b accounts for the finite volume of the molecules themselves (reducing the available free space). Each gas has unique Van der Waals constants a and b determined experimentally. Gases with strong intermolecular forces (like water vapor and ammonia) have large a values and deviate from ideal behavior more than gases with weak forces (like helium and neon).
See also: Concentration Calculator · Molar Mass · pH Calculator · Pressure Converter · Temperature Converter
→ The ideal gas law is most accurate at low pressures and high temperatures. Real gases deviate from PV = nRT at high pressures (molecules crowd together) and low temperatures (intermolecular forces become significant). For most everyday conditions (near atmospheric pressure, above 0°C), the ideal gas law is accurate within 1–5%.
→ Always use absolute temperature — Kelvin, not Celsius. This is the most common student error. 20°C is 293.15 K, not 20 K. Using Celsius gives an answer that's off by roughly a factor of 15. Zero Kelvin = -273.15°C is the theoretical minimum where molecular motion stops.
→ At STP (0°C, 1 atm), one mole of any ideal gas occupies 22.4 liters. This is a useful benchmark for sanity-checking your answers. At room temperature (25°C, 1 atm), the molar volume increases to about 24.5 L. For related chemistry calculations, see our Molar Mass Calculator.
→ Combined gas law problems are just PV = nRT with n constant. When the amount of gas doesn't change, P₁V₁/T₁ = P₂V₂/T₂. This handles balloon inflation, tire pressure changes with temperature, and gas compression problems without needing to know the actual number of moles. Explore other physics calculations with our Pressure Converter.
See also: Molar Mass Calculator · Pressure Converter · Density Calculator · Concentration Calculator