💨
✓ Editorially reviewed by Derek Giordano, Founder & Editor · BA Business Marketing

Ideal Gas Law Calculator

PV = nRT

Last reviewed: January 2026

🧮
500 calculators, no signup required
Finance · Health · Math · Science · Business
nnng.com

What Is an Ideal Gas Law Calculator?

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: PV = nRT

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).

The Variables Explained

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.

Standard Conditions

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.

Example Problems

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).

When the Ideal Gas Law Fails

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.

Related Gas Laws

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.

Ideal Gas Law Variables

VariableSymbolSI UnitOther Common Units
PressurePPascals (Pa)atm, mmHg, psi
VolumeVCubic meters (m³)Liters (L)
AmountnMoles (mol)
TemperatureTKelvin (K)°C + 273.15
Gas constantR8.314 J/(mol·K)0.08206 L·atm/(mol·K)

The Ideal Gas Law Explained

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.

Real-World Applications

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.

Deviations from Ideal Behavior

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).

What is the ideal gas law formula?
PV = nRT, where P = pressure (atm), V = volume (L), n = moles of gas, R = gas constant (0.08206 L⋅atm/mol⋅K), and T = temperature in Kelvin. Temperature MUST be in Kelvin — add 273.15 to Celsius. This equation lets you solve for any one variable if you know the other three.
Why must temperature be in Kelvin?
Because the ideal gas law describes a proportional relationship between temperature and volume/pressure. At 0°C, gas molecules still have kinetic energy — they don't stop. Kelvin starts at absolute zero (−273.15°C), where molecular motion theoretically ceases. Using Celsius would break the proportionality because 0°C doesn't mean zero energy.
What volume does 1 mole of gas occupy at STP?
22.414 liters at STP (0°C, 1 atm). This is called the molar volume and is the same for all ideal gases regardless of molecular weight. At room temperature (25°C, 1 atm), the molar volume is about 24.47 liters. Memorizing 22.4 L/mol at STP is one of the most useful chemistry shortcuts. For a related calculation, try our Dilution Calculator.
When does the ideal gas law not work?
The ideal gas law assumes gas molecules have no volume and no intermolecular forces. It fails at high pressures (where molecular volume matters), low temperatures (where intermolecular attractions become significant), and for polar molecules with strong intermolecular forces. Below about -50°C or above 100 atm, the van der Waals equation or other real gas models are needed for accurate results.
How do I use the ideal gas law to solve problems?
Identify which variables are known and which is unknown. Ensure all units are consistent — temperature MUST be in Kelvin (add 273.15 to °C), and R must match your pressure and volume units. Rearrange PV = nRT to solve for the unknown: P = nRT/V, V = nRT/P, n = PV/RT, T = PV/nR. At standard temperature and pressure (STP: 0°C, 1 atm), one mole of any ideal gas occupies 22.4 liters.

See also: Concentration Calculator · Molar Mass · pH Calculator · Pressure Converter · Temperature Converter

How to Use This Calculator

  1. Select the variable to solve for — Choose whether to solve for pressure (P), volume (V), number of moles (n), or temperature (T). The calculator rearranges PV = nRT automatically.
  2. Enter the three known values — Input the remaining variables with units. The calculator accepts pressure in atm, kPa, mmHg, or psi; volume in liters or mL; temperature in Kelvin or Celsius.
  3. Verify your temperature is in Kelvin — The ideal gas law requires absolute temperature. If you enter Celsius, the calculator converts to Kelvin (add 273.15). Using Celsius directly in the equation gives wildly wrong results.
  4. Read the calculated result — The calculator solves for the unknown and shows the answer with unit conversion options. It also displays the value of R used (8.314 J·mol⁻¹·K⁻¹ or 0.0821 L·atm·mol⁻¹·K⁻¹ depending on units).

Tips and Best Practices

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

📚 Sources & References
  1. [1] NIST. Gas Constants. NIST.gov
  2. [2] Khan Academy. Ideal Gas Law. KhanAcademy.org
  3. [3] OpenStax. Chemistry — Gases. OpenStax.org
  4. [4] IUPAC. Gas Law Standards. IUPAC.org
Editorial Standards — Every calculator is built from peer-reviewed formulas and official data sources, editorially reviewed for accuracy, and updated regularly. Read our full methodology · About the author