Ideal Gas Law Calculator

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

🌡️ Thermodynamics📐 PV = nRT💨 Ideal Gas
Moles (n)
Temperature (T)
Temp unit
Volume (V)
Volume unit
⚠️ Enter valid positive numbers. Temperature must be above absolute zero.

What Is Ideal Gas Law?

The ideal gas law combines three classical gas laws into one equation: PV = nRT, where P is pressure (Pa), V is volume (m³), n is the number of moles, R = 8.314 J/(mol·K) is the universal gas constant, and T is temperature in Kelvin (K = °C + 273.15). This equation describes the behavior of an ideal gas — one with no intermolecular forces and negligible particle volume.

The ideal gas law is derived from combining Boyle's Law (PV = constant at fixed n, T), Charles's Law (V/T = constant at fixed n, P), and Avogadro's Law (V ∝ n at fixed P, T). At standard temperature and pressure (STP: 0°C, 1 atm = 101,325 Pa), one mole of ideal gas occupies exactly 22.414 liters.

Real gases deviate from ideal behavior at high pressures (molecules are close, interactions matter) and low temperatures (kinetic energy is low relative to intermolecular forces). The Van der Waals equation (P + a/V²)(V − b) = nRT corrects for these with gas-specific constants a (attraction) and b (molecular volume). For everyday temperatures and moderate pressures, the ideal gas law provides excellent accuracy (< 1% error for many gases).

The ideal gas law is fundamental to thermodynamics, chemical engineering, meteorology, and astrophysics. It explains the compression of air in a bicycle pump (temperature rise), the expansion of hot air balloons (volume increases with temperature), scuba tank pressure changes with depth and temperature, and the behavior of stellar atmospheres.

Formula Reference Table

Solve ForFormulaNotes
Ideal Gas LawPV = nRTR = 8.314 J/(mol·K)
Find PP = nRT/VPa (Pascals)
Find VV = nRT/P
Find nn = PV/(RT)moles
Find TT = PV/(nR)Kelvin
STP molar volumeV_m = 22.414 L/molAt 0°C, 101.325 kPa
kPa to Pa1 kPa = 1,000 Pa; 1 atm = 101,325 PaUnit conversions

3 Worked Examples

Example 1
Verify STP Molar Volume

One mole of ideal gas at 0°C, 1 atm. Verify V = 22.4 L.

  • n=1, T=273.15 K, P=101,325 Pa, R=8.314
  • V = nRT/P = 1 × 8.314 × 273.15 / 101,325
  • V = 2,270.9 / 101,325 = 0.02241 m³ = 22.41 L ✓
✓ V = 22.41 L at STP ✓
Example 2
Scuba Tank Pressure

How many moles of air in a 12-L scuba tank at 200 bar (20,000,000 Pa) and 25°C?

  • T = 298.15 K, V = 0.012 m³
  • n = PV/(RT) = 20,000,000 × 0.012 / (8.314 × 298.15)
  • n = 240,000 / 2,479 = 96.8 mol
  • Mass of air ≈ 96.8 × 29 g/mol = 2,807 g = 2.8 kg
✓ n = 96.8 mol ≈ 2.8 kg of air
Example 3
Hot Air Balloon Volume

At ground (20°C = 293 K), n = 1,000 mol air, P = 101,325 Pa. Heat to 100°C (373 K). New volume?

  • V₁/T₁ = V₂/T₂ (Charles's law at constant P)
  • V₁ = nRT₁/P = 1000 × 8.314 × 293 / 101,325 = 24.03 m³
  • V₂ = nRT₂/P = 1000 × 8.314 × 373 / 101,325 = 30.60 m³
  • Volume increases 27.3% — reduces air density for lift
✓ Volume increases from 24.0 to 30.6 m³ at 100°C

Real-World Applications

🎈
Hot Air Balloons
Heating air reduces its density (V increases at constant P). Hot air in the balloon envelope is less dense than cooler outside air, providing Archimedes buoyancy. Pilots control altitude by adjusting burner heat.
🤿
Scuba Diving
At 10 m depth, pressure doubles (2 atm). PV = nRT: at constant T, volume halves. Scuba tanks hold high-pressure (200–300 bar) gas. As pressure decreases on ascent, gas volume expands — exhaling continuously prevents lung overexpansion injuries.
⚗️
Chemical Engineering
Gas reactions require precise P, V, T relationships. Reactors are designed using ideal (and real) gas laws to predict volumes, concentrations, and required containment pressures at process temperatures.
🌤️
Meteorology
Atmospheric pressure, temperature, and humidity follow gas laws. The Ideal Gas Law governs air density, which determines buoyancy, convection, cloud formation, and storm development. Weather models solve gas law equations at millions of grid points.
🏭
Industrial Gases
Compressed gas cylinders (O₂, N₂, CO₂, H₂) are sized using PV = nRT to determine how many moles are stored and how long they will last at a given flow rate. This calculator is a standard tool for industrial gas applications.

Common Mistakes to Avoid

⚠️
Forgetting to convert °C to Kelvin

PV = nRT requires T in Kelvin. T(K) = T(°C) + 273.15. Using T = 25 (meaning °C) instead of 298.15 K gives an answer 298.15/25 ≈ 11.9× too small.

⚠️
Wrong pressure units

R = 8.314 J/(mol·K) requires P in Pascals (Pa). 1 atm = 101,325 Pa. 1 bar = 100,000 Pa. Using atm without converting gives wrong results.

⚠️
Wrong volume units

V must be in m³ when using R = 8.314. 1 liter = 0.001 m³. Forgetting to convert liters gives volume 1,000× too large.

⚠️
Applying ideal gas law to real gases at extreme conditions

Above ~100 atm or near the boiling point, real gas deviations become significant. Use Van der Waals or other equations of state for accurate results at extreme pressures.

⚠️
Confusing moles with mass

n = mass/molar mass. 1 mole of N₂ (M = 28 g/mol) = 28 g. Using mass in grams instead of moles gives n 1/(molar mass) times too small.

Frequently Asked Questions

What is an ideal gas?
An ideal gas consists of point particles (negligible volume) with no intermolecular forces except elastic collisions. PV = nRT describes it exactly. Real gases approximate ideal behavior at low P, high T. No gas is perfectly ideal, but N₂, O₂, He, and Ar are excellent approximations at room temperature and moderate pressures.
What is the gas constant R?
R = 8.314 J/(mol·K) = 8.314 Pa·m³/(mol·K) = 0.08206 L·atm/(mol·K). It's Boltzmann's constant k_B scaled by Avogadro's number N_A: R = k_B × N_A = 1.381×10⁻²³ × 6.022×10²³ = 8.314. Use R = 8.314 when P is in Pa, V in m³; use R = 0.08206 when P in atm, V in liters.
What are Boyle's, Charles's, and Gay-Lussac's Laws?
Boyle's Law: PV = constant (constant n, T) — pressure and volume inversely related. Charles's Law: V/T = constant (constant n, P) — volume proportional to temperature. Gay-Lussac's Law: P/T = constant (constant n, V) — pressure proportional to temperature. The ideal gas law PV = nRT combines all three plus Avogadro's Law.
What happens to gas in a sealed container when heated?
At constant volume: P/T = constant (Gay-Lussac). Doubling T (in Kelvin) doubles P. This is why pressure cookers build pressure at boiling temperature, and why aerosol cans warn against incineration — heat increases P until the can ruptures.
What is STP and why is it used?
STP (Standard Temperature and Pressure): 0°C (273.15 K) and 1 bar (100,000 Pa) [new IUPAC definition] or 1 atm (101,325 Pa) [old definition]. At STP, one mole of ideal gas occupies 22.414 L (old) or 22.711 L (new). STP provides a reference point for comparing gas volumes across different conditions.
How does the Van der Waals equation improve on ideal gas?
(P + a/V_m²)(V_m − b) = RT, where V_m = V/n is molar volume. The 'a' term corrects for intermolecular attractions (reduces effective P); the 'b' term corrects for finite molecular volume (reduces effective V). Real gases have significant a, b values at high pressure or near condensation — CO₂: a = 3.64, b = 0.0427 L/mol.
What is Avogadro's Law?
Equal volumes of ideal gases at the same T and P contain equal numbers of molecules (moles). V ∝ n at constant T, P. This means 22.4 L of any ideal gas at STP contains 1 mole = 6.022×10²³ molecules — regardless of whether it's H₂ (2 g/mol) or CO₂ (44 g/mol).
How is the ideal gas law used in breathing?
During inhalation, the diaphragm increases thoracic volume. By the ideal gas law (V increases → P decreases at constant n, T), lung pressure drops below atmospheric, causing air to flow in. Exhalation is the reverse. Altitude reduces atmospheric P, so lung expansion provides fewer moles of O₂ for the same volume — altitude sickness results.

Related Physics Calculators

Formula Explorer connections

Interpretation: This formula tracks heat, temperature, work, entropy or transport in a thermodynamic system. Assumption: Use absolute temperature where required and consistent energy units. Constant properties, equilibrium, ideal gases or negligible losses may be assumed.

Latent Heat Calculator →Specific Heat Calculator →Specific Heat Ratio Calculator →Physics Formula Explorer →