Ideal Gas Law Calculator
Calculate pressure, volume, moles, or temperature using PV = nRT
What Is the Ideal Gas Law?
The ideal gas law (PV = nRT) relates the four properties of a gas—pressure, volume, temperature, and amount—through a single equation. It's one of the most important relationships in chemistry and physics, allowing prediction of gas behavior under various conditions.
| Variable | Symbol | Common Units | SI Units |
|---|---|---|---|
| Pressure | P | atm, mmHg, torr, psi | Pa (N/m²) |
| Volume | V | L, mL | m³ |
| Amount | n | mol | mol |
| Temperature | T | °C (convert!) | K (Kelvin) |
| Gas constant | R | 0.0821 L·atm/(mol·K) | 8.314 J/(mol·K) |
Ideal Gas Law
Where:
- P= Pressure
- V= Volume
- n= Number of moles
- R= Universal gas constant
- T= Absolute temperature (Kelvin)
Values of the Gas Constant R
The gas constant R has different numerical values depending on the units used. Choose R to match your pressure and volume units.
| R Value | Units | When to Use |
|---|---|---|
| 0.08206 | L·atm/(mol·K) | P in atm, V in L (most common) |
| 8.314 | J/(mol·K) or L·kPa/(mol·K) | SI units or P in kPa |
| 62.36 | L·mmHg/(mol·K) or L·torr/(mol·K) | P in mmHg or torr |
| 1.987 | cal/(mol·K) | Energy calculations in calories |
| 8.314×10⁻³ | L·bar/(mol·K) | P in bar |
Critical: Always use Kelvin for temperature! K = °C + 273.15
Related Gas Laws (Special Cases)
The ideal gas law encompasses several earlier gas laws, which are special cases when certain variables are held constant.
| Law | Formula | Held Constant | Relationship |
|---|---|---|---|
| Boyle's Law | P₁V₁ = P₂V₂ | n, T | P ∝ 1/V |
| Charles's Law | V₁/T₁ = V₂/T₂ | n, P | V ∝ T |
| Gay-Lussac's Law | P₁/T₁ = P₂/T₂ | n, V | P ∝ T |
| Avogadro's Law | V₁/n₁ = V₂/n₂ | P, T | V ∝ n |
| Combined Gas Law | P₁V₁/T₁ = P₂V₂/T₂ | n | Combines Boyle + Charles |
Combined Gas Law
Where:
- P₁, V₁, T₁= Initial pressure, volume, temperature
- P₂, V₂, T₂= Final pressure, volume, temperature
Standard Temperature and Pressure (STP)
STP provides standard reference conditions for comparing gas volumes. At STP, one mole of any ideal gas occupies 22.4 liters.
| Standard | Temperature | Pressure | Molar Volume |
|---|---|---|---|
| STP (old/common) | 273.15 K (0°C) | 1 atm (101.325 kPa) | 22.414 L/mol |
| SATP (newer) | 298.15 K (25°C) | 1 bar (100 kPa) | 24.79 L/mol |
| NTP | 293.15 K (20°C) | 1 atm | 24.04 L/mol |
Quick conversions at STP: n = V/22.4 (moles from liters), V = 22.4n (liters from moles)
Density and Molar Mass of Gases
The ideal gas law can be rearranged to calculate gas density and molar mass.
| To Find | Formula | Derivation |
|---|---|---|
| Density (ρ) | ρ = PM / RT | From PV = nRT and n = m/M |
| Molar mass (M) | M = ρRT / P | Rearranged density formula |
| Molar mass | M = mRT / PV | Using mass directly |
Gas Density Formula
Where:
- ρ= Density (g/L or kg/m³)
- M= Molar mass (g/mol)
- P= Pressure
- R= Gas constant
- T= Temperature (K)
Real Gases vs Ideal Gases
Real gases deviate from ideal behavior at high pressures and low temperatures. The van der Waals equation accounts for these deviations.
| Condition | Ideal Gas Assumption | Real Gas Reality | Effect |
|---|---|---|---|
| High pressure | Molecules have no volume | Molecules occupy space | V observed > V predicted |
| Low temperature | No intermolecular forces | Attractive forces exist | P observed < P predicted |
| Near condensation | Gas phase only | Phase change possible | Ideal law fails |
Van der Waals equation: (P + an²/V²)(V - nb) = nRT, where a and b are gas-specific constants.
When ideal is good enough: Low pressure (< 5 atm), high temperature (> 0°C), non-polar gases, approximate calculations.
Applications of the Ideal Gas Law
The ideal gas law has widespread applications in science, engineering, and everyday life.
| Application | How It's Used | Example |
|---|---|---|
| Weather forecasting | Relate P, V, T changes | Predict storm pressure changes |
| Scuba diving | Tank pressure at depth | Calculate air supply duration |
| Automotive | Tire pressure with temperature | TPMS warnings in cold weather |
| Industrial processes | Gas storage, compression | Natural gas transport |
| Respiratory medicine | Lung volumes, oxygen delivery | Ventilator settings |
| Chemical synthesis | Gas stoichiometry | Calculate reactant volumes |
Worked Examples
Calculate Volume of a Gas
Problem:
What volume does 2.5 moles of oxygen gas occupy at 25°C and 1 atm?
Solution Steps:
- 1Identify variables: n = 2.5 mol, T = 25°C = 298 K, P = 1 atm, R = 0.0821 L·atm/(mol·K)
- 2Rearrange for V: V = nRT/P
- 3Substitute: V = (2.5 × 0.0821 × 298) / 1
- 4Calculate: V = 61.2 L
Result:
The oxygen gas occupies 61.2 liters. Compare to STP: at 0°C it would be 2.5 × 22.4 = 56 L—slightly less due to lower temperature.
Calculate Moles from Gas Properties
Problem:
How many moles of gas are in a 5.0 L container at 750 mmHg and 30°C?
Solution Steps:
- 1Convert units: T = 30 + 273 = 303 K; R = 62.36 L·mmHg/(mol·K)
- 2Rearrange for n: n = PV/RT
- 3Substitute: n = (750 × 5.0) / (62.36 × 303)
- 4Calculate: n = 3750 / 18895 = 0.198 mol
Result:
There are 0.198 moles (about 0.2 mol) of gas in the container. This is independent of what gas it is—all ideal gases behave the same.
Calculate Molar Mass from Density
Problem:
An unknown gas has a density of 1.96 g/L at STP. What is its molar mass?
Solution Steps:
- 1At STP: T = 273 K, P = 1 atm, R = 0.0821 L·atm/(mol·K)
- 2Use formula: M = ρRT/P
- 3Substitute: M = (1.96 × 0.0821 × 273) / 1
- 4Calculate: M = 43.9 g/mol
Result:
Molar mass ≈ 44 g/mol. This matches CO₂ (44.01 g/mol) or C₃H₈ propane (44.10 g/mol). Additional tests would identify the specific gas.
Tips & Best Practices
- ✓Always convert temperature to Kelvin: K = °C + 273.15 (or approximately +273).
- ✓Match your R value to your pressure and volume units—this is the most common error source.
- ✓At STP (0°C, 1 atm), one mole of any ideal gas occupies 22.4 liters.
- ✓For gas mixtures, apply the ideal gas law to total moles for total pressure.
- ✓The combined gas law (P₁V₁/T₁ = P₂V₂/T₂) is useful when n is constant.
- ✓Gas density = PM/RT; use this to find molar mass of unknown gases.
- ✓Real gases deviate most at high P and low T—use van der Waals for precision.
Frequently Asked Questions
Sources & References
- Chemistry LibreTexts - Gas Laws (2024)
- NIST Chemistry WebBook (2024)
- OpenStax Chemistry 2e (2023)
- CRC Handbook of Chemistry and Physics (2024)
Last updated: 2026-01-22