Ideal Gas Law Calculator

Ideal Gas Law Calculator

Ideal Gas Law

PV = nRT

Tip: K = °C + 273.15

Standard Conditions (STP):

Old STP (pre-1982):
T = 273.15 K (0°C)
P = 1 atm = 101.325 kPa
V = 22.414 L/mol
Current STP (IUPAC):
T = 273.15 K (0°C)
P = 100 kPa = 1 bar
V = 22.711 L/mol

What This Calculator Does

The Ideal Gas Law calculator solves for any one variable (P, V, n, or T) when the other three are known. This fundamental equation describes the behavior of ideal gases and provides excellent approximations for real gases under most conditions.

The calculator supports multiple gas constants (R) to match your unit preferences, automatically adjusting calculations for atmospheres, pascals, kilopascals, or millimeters of mercury.

The Ideal Gas Law Equation

PV = nRT

Where:

  • P = Pressure (atm, kPa, mmHg, or Pa)
  • V = Volume (liters)
  • n = Number of moles (mol)
  • R = Universal gas constant
  • T = Absolute temperature (Kelvin)

Rearranged Forms:

Solve for Pressure:

P = nRT / V

Solve for Volume:

V = nRT / P

Solve for Moles:

n = PV / RT

Solve for Temperature:

T = PV / nR

💡 Important: Temperature Must Be in Kelvin

Always convert Celsius to Kelvin: K = °C + 273.15
Common temperatures: 0°C = 273.15 K, 25°C = 298.15 K, 100°C = 373.15 K

Gas Constant (R) Values

The gas constant R has different numerical values depending on the units used. Choose the R value that matches your pressure and volume units:

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

Most common for chemistry problems with pressure in atmospheres and volume in liters

R = 8.314 J/(mol·K)

SI units - useful for thermodynamics and energy calculations (1 J = 1 Pa·L)

R = 8.314 L·kPa/(mol·K)

For pressure in kilopascals (1 atm = 101.325 kPa)

R = 62.36 L·mmHg/(mol·K)

For pressure in millimeters of mercury (1 atm = 760 mmHg)

R = 1.987 cal/(mol·K)

For energy calculations in calories

Step-by-Step Example Problems

Example 1: Calculate pressure of 2.0 mol gas at 25°C in 10 L

Given:

  • n = 2.0 mol
  • T = 25°C = 298.15 K
  • V = 10 L
  • R = 0.0821 L·atm/(mol·K)

Find: Pressure (P)

Solution:

P = nRT / V

P = (2.0 mol × 0.0821 L·atm/(mol·K) × 298.15 K) / 10 L

P = 48.94 L·atm / 10 L

P = 4.89 atm

Example 2: What volume does 1 mol of gas occupy at STP?

Given (STP):

  • n = 1.0 mol
  • T = 273.15 K (0°C)
  • P = 1.0 atm
  • R = 0.0821 L·atm/(mol·K)

Find: Volume (V)

Solution:

V = nRT / P

V = (1.0 mol × 0.0821 L·atm/(mol·K) × 273.15 K) / 1.0 atm

V = 22.41 L

Result: At STP, 1 mole of ideal gas occupies 22.4 L (molar volume)

Example 3: How many moles in 5.0 L at 2.0 atm and 300 K?

Given:

  • P = 2.0 atm
  • V = 5.0 L
  • T = 300 K
  • R = 0.0821 L·atm/(mol·K)

Find: Moles (n)

Solution:

n = PV / RT

n = (2.0 atm × 5.0 L) / (0.0821 L·atm/(mol·K) × 300 K)

n = 10.0 atm·L / 24.63 L·atm/mol

n = 0.406 mol

Example 4: At what temperature does 0.5 mol occupy 12 L at 1 atm?

Given:

  • n = 0.5 mol
  • V = 12 L
  • P = 1.0 atm
  • R = 0.0821 L·atm/(mol·K)

Find: Temperature (T)

Solution:

T = PV / nR

T = (1.0 atm × 12 L) / (0.5 mol × 0.0821 L·atm/(mol·K))

T = 12 atm·L / 0.04105 L·atm/K

T = 292.3 K = 19.2°C

Common Mistakes to Avoid

❌ Using Celsius instead of Kelvin

Temperature MUST be in Kelvin. Always add 273.15 to convert from °C. Using °C will give completely wrong answers.

❌ Mismatching R constant with pressure units

If pressure is in kPa, use R = 8.314 L·kPa/(mol·K), not 0.0821. Always verify your units match your R value.

❌ Converting mL to L incorrectly

Volume must be in liters. Divide mL by 1000: 500 mL = 0.5 L, not 5 L.

❌ Using mass instead of moles

The equation requires moles (n), not mass. Convert grams to moles using: n = mass / molar mass.

❌ Assuming all gases are ideal

Real gases deviate at high pressures (>10 atm) or low temperatures (near liquefaction). Use van der Waals equation for accurate results in extreme conditions.

When Does the Ideal Gas Law Apply?

✅ Good Approximation When:

  • Low pressure (< 5 atm)
  • High temperature (> 0°C)
  • Small, non-polar molecules (He, H₂, N₂, O₂)
  • Dilute gases
  • No strong intermolecular forces

⚠️ Poor Approximation When:

  • High pressure (> 10 atm)
  • Low temperature (near boiling point)
  • Polar molecules (H₂O, NH₃)
  • Large molecules (hydrocarbons)
  • Strong hydrogen bonding or dipole interactions

Frequently Asked Questions

Why must temperature be in Kelvin and not Celsius?

The Ideal Gas Law is derived from kinetic theory where temperature represents average kinetic energy. Kelvin is an absolute scale starting from absolute zero (no molecular motion). Using Celsius would give negative temperatures and nonsensical results since volume and pressure cannot be negative.

What is the difference between STP and standard conditions?

STP (Standard Temperature and Pressure) changed in 1982. Old STP: 0°C, 1 atm (22.4 L/mol). Current IUPAC STP: 0°C, 1 bar = 100 kPa (22.7 L/mol). Standard conditions for thermodynamics: 25°C, 1 atm or 1 bar (24.5 L/mol). Always clarify which standard you're using.

Can I use this calculator for gas mixtures?

Yes! For gas mixtures, use the total moles (n = n₁ + n₂ + n₃ + ...) to find total pressure. For partial pressures, use Dalton's Law: Pᵢ = χᵢ × P_total, where χᵢ is the mole fraction of gas i.

How do I convert between different pressure units?

Common conversions: 1 atm = 101.325 kPa = 101,325 Pa = 760 mmHg = 760 torr = 14.7 psi = 1.01325 bar. Either convert all pressures to one unit, or use the appropriate R constant for your pressure unit.

What causes real gases to deviate from ideal behavior?

Two main factors: (1) Molecular volume - real gas molecules occupy space, reducing available volume. (2) Intermolecular forces - attractions between molecules reduce pressure compared to ideal predictions. The van der Waals equation corrects for both effects.

How do I find the density of a gas using PV=nRT?

Density = mass/volume. Since n = mass/MM, substitute into PV=nRT to get: density = (P × MM) / (RT). This shows density is proportional to pressure and molar mass, inversely proportional to temperature.

Real-World Applications

Scuba Diving

Calculate how much air is compressed in dive tanks (typical: 3000 psi ≈ 200 atm). Understand how pressure increases with depth affect gas consumption and decompression requirements.

Weather Balloons

Predict balloon expansion as atmospheric pressure decreases with altitude. Design balloons to withstand pressure changes from sea level (1 atm) to stratosphere (0.01 atm).

Chemical Reactors

Calculate optimal conditions for gas-phase reactions. Determine pressure vessels sizes needed for industrial synthesis of ammonia (Haber process), sulfuric acid (contact process).

Automotive Engineering

Calculate tire pressure changes with temperature. Design fuel injection systems accounting for air density variations. Predict airbag inflation rates based on gas generator output.

Respiratory Therapy

Calculate oxygen tank capacity for medical use. Determine appropriate flow rates for ventilators. Design portable oxygen concentrators for patients with respiratory conditions.

Food Packaging

Modified atmosphere packaging (MAP) uses CO₂ and N₂ to extend shelf life. Calculate gas mixtures needed for different products. Predict pressure changes during shipping and storage.

Quick Reference

Units

atm, L, mol, K

Formula

PV = nRT

Applications

Gas behavior, engineering

Level

High school chemistry

Where It's Used

🎈

Engineering

HVAC, compression

🔬

Laboratory

Gas calculations

🏥

Medical

Respiratory therapy

🏭

Industry

Process control