Ideal Gas Law Calculator — PV = nRT
Solve the ideal gas law PV=nRT for pressure, volume, moles, or temperature. Use the combined gas law for Boyle's, Charles's, and Gay-Lussac's law problems, find molar mass of unknown gases, and compare ideal vs real gas with the Van der Waals equation — all with full step-by-step working.
Leave exactly ONE field empty below — the ideal gas law calculator solves for it automatically.
Ideal Gas Law PV=nRT — Result
The combined gas law links two states of the same fixed amount of gas. Leave exactly ONE of the six fields empty.
State 1 — Initial
State 2 — Final
Combined Gas Law Result
Find the molar mass of an unknown gas from its mass, pressure, volume, and temperature (always in Kelvin).
Molar Mass — Ideal Gas Law M = mRT/(PV)
Corrects PV=nRT for intermolecular attraction (a) and molecular volume (b). Calculates P for both ideal and real gas — compare the deviation.
Ideal Gas PV=nRT
Van der Waals (Real)
| Form | Equation | Used When |
|---|---|---|
| Standard | PV = nRT | Most common ideal gas law form |
| Density | PM = ρRT | Finding gas density ρ (g/L) |
| Molar mass | M = mRT/(PV) | Identifying unknown gas from mass, P, V, T |
| Mass | m = MPV/(RT) | Finding mass of gas sample |
| Specific gas | Pv = R_s·T | Engineering — per kg basis (v = specific volume) |
| Value | Units | Use Case |
|---|---|---|
| 8.31446 | J/(mol·K) = Pa·m³/(mol·K) | SI physics — use with Pa and m³ |
| 0.082057 | L·atm/(mol·K) | Chemistry (most common) ← R = 0.082057 L·atm/(mol·K) |
| 8.31446 | L·kPa/(mol·K) | Metric chemistry — use with kPa and L |
| 62.364 | L·mmHg/(mol·K) | Medical / barometric pressure |
| 0.083145 | L·bar/(mol·K) | European chemistry / IUPAC |
| 1.9872 | cal/(mol·K) | Thermochemistry |
| Gas | R_s (J/kg·K) | Molar Mass (g/mol) | γ = Cp/Cv |
|---|---|---|---|
| Air | 287.058 | 28.97 | 1.400 |
| Helium (He) | 2077.1 | 4.003 | 1.667 |
| Hydrogen (H₂) | 4124.2 | 2.016 | 1.405 |
| Nitrogen (N₂) | 296.80 | 28.014 | 1.400 |
| Oxygen (O₂) | 259.84 | 31.999 | 1.395 |
| CO₂ | 188.92 | 44.010 | 1.289 |
| Argon (Ar) | 208.13 | 39.948 | 1.667 |
| Methane (CH₄) | 518.28 | 16.043 | 1.305 |
| Water vapor | 461.52 | 18.015 | 1.330 |
| Ammonia (NH₃) | 488.21 | 17.031 | 1.310 |
| Law | Formula | Held Constant | Discoverer |
|---|---|---|---|
| Boyle's Law | P₁V₁ = P₂V₂ | T, n | Robert Boyle (1662) |
| Charles's Law | V₁/T₁ = V₂/T₂ | P, n | Jacques Charles (1787) |
| Gay-Lussac's Law | P₁/T₁ = P₂/T₂ | V, n | Joseph Gay-Lussac (1808) |
| Avogadro's Law | V₁/n₁ = V₂/n₂ | P, T | Amedeo Avogadro (1811) |
| Combined Gas Law | P₁V₁/T₁ = P₂V₂/T₂ | n | All three combined |
| Ideal Gas Law | PV = nRT | — | Émile Clapeyron (1834) |
| Condition | Temperature | Pressure | Molar Volume |
|---|---|---|---|
| STP (old, pre-1982) | 0°C = 273.15 K | 1 atm = 101.325 kPa | 22.414 L/mol |
| STP (IUPAC, post-1982) | 0°C = 273.15 K | 100 kPa exactly | 22.711 L/mol |
| SATP | 25°C = 298.15 K | 100 kPa | 24.789 L/mol |
| NTP | 20°C = 293.15 K | 1 atm = 101.325 kPa | 24.055 L/mol |
| Gas | a (L²·atm/mol²) | b (L/mol) | Notes |
|---|---|---|---|
| Helium (He) | 0.0341 | 0.02370 | Most ideal gas behavior of any real gas |
| Hydrogen (H₂) | 0.244 | 0.02661 | Very close to ideal |
| Neon (Ne) | 0.211 | 0.01709 | Noble gas, nearly ideal |
| Nitrogen (N₂) | 1.390 | 0.03913 | Major component of air |
| Oxygen (O₂) | 1.360 | 0.03183 | — |
| Argon (Ar) | 1.355 | 0.03201 | Noble gas |
| Methane (CH₄) | 2.253 | 0.04278 | Natural gas |
| CO₂ | 3.640 | 0.04267 | Strong deviation from ideal at high P |
| Ammonia (NH₃) | 4.169 | 0.03707 | Polar — strong intermolecular forces |
| Water vapor (H₂O) | 5.536 | 0.03049 | Most non-ideal — strongest H-bonding |
Gas Law Triangle (PVT Triangle): Picture P, V, T at the corners of a triangle. Cover the unknown corner — the remaining two show the relationship. Cover T → P and V are inversely proportional (Boyle's Law). Cover P → V and T are directly proportional (Charles's Law). Cover V → P and T are directly proportional (Gay-Lussac's Law). All three together give the combined gas law P₁V₁/T₁ = P₂V₂/T₂.
Ideal Gas Law Calculator — Solve PV=nRT, Combined Gas Law & More
This ideal gas law calculator solves PV=nRT for any single unknown variable — pressure, volume, moles, or temperature — with full step-by-step working. It also solves the combined gas law (P₁V₁/T₁=P₂V₂/T₂) covering Boyle's law, Charles's law, and Gay-Lussac's law; finds the molar mass of an unknown gas using M=mRT/(PV); and compares ideal versus real gas behavior using the Van der Waals equation (P+an²/V²)(V−nb)=nRT.
The Ideal Gas Law — PV = nRT
The ideal gas law is written PV = nRT, where each variable has a precise meaning and specific units that must be consistent:
- P = absolute pressure (atm, kPa, Pa, bar, psi, mmHg, or torr)
- V = volume of gas (L, mL, cm³, m³, or ft³)
- n = amount of gas in moles (mol)
- R = universal gas constant — R = 0.082057 L·atm/(mol·K) is the most common form in chemistry; R = 8.31446 J/(mol·K) in SI units
- T = absolute temperature in Kelvin — ALWAYS convert from °C or °F before using PV=nRT
⚠ The single most important rule in the ideal gas law PV=nRT: temperature MUST be in Kelvin. Convert FIRST: T(K) = T(°C) + 273.15. A student who enters T=25 (thinking 25°C) instead of T=298.15K gets an answer that is 298.15/25 = 11.9 times too small — with no visible error flag. This is the #1 cause of wrong answers in PV=nRT calculations.
The ideal gas law PV=nRT combines Boyle's law, Charles's law, and Avogadro's law into one unified equation. Rearranging PV=nRT gives four useful forms for solving any variable:
What Is an Ideal Gas? — Definition and Assumptions
An ideal gas is a theoretical gas that obeys PV=nRT exactly under all conditions of pressure and temperature. The ideal gas model rests on five fundamental assumptions that define what makes a gas ideal:
- Negligible molecular volume: Gas molecules are treated as point masses — their volume is negligible compared to the container volume
- No intermolecular forces: There are no attractive or repulsive forces between molecules in an ideal gas
- Perfectly elastic collisions: All collisions between molecules (and with container walls) conserve kinetic energy exactly
- Constant random motion: Ideal gas molecules move in constant, completely random motion in all directions
- Temperature proportional to kinetic energy: The average kinetic energy of ideal gas molecules is directly proportional to absolute temperature (Kelvin)
No real gas is perfectly ideal in all conditions. Real gases approach ideal gas behavior under low pressure (molecules are far apart, so intermolecular forces become negligible) and high temperature (kinetic energy dominates over weak intermolecular attractions). Helium and hydrogen are the most ideal real gases because their molecules are tiny and interact very weakly — helium has Van der Waals constant a=0.0341, the smallest of any gas.
The difference between ideal and non-ideal gas behavior is quantified by the compressibility factor Z = PV/(nRT). For an ideal gas, Z=1 exactly. For real non-ideal gases, Z deviates from 1 at high pressure or low temperature.
Combined Gas Law — P₁V₁/T₁ = P₂V₂/T₂
When a fixed amount of gas (constant n) changes from one set of conditions to another, the combined gas law applies: P₁V₁/T₁ = P₂V₂/T₂. The combined gas law calculator above handles three special cases automatically by detecting which variables are held equal:
- Boyle's Law (T₁ = T₂, temperature constant): P₁V₁ = P₂V₂ — pressure and volume are inversely proportional. Compress a gas at constant temperature and the pressure rises proportionally.
- Charles's Law (P₁ = P₂, pressure constant): V₁/T₁ = V₂/T₂ — volume and temperature (in Kelvin) are directly proportional. Heat a gas at constant pressure and it expands.
- Gay-Lussac's Law (V₁ = V₂, volume constant): P₁/T₁ = P₂/T₂ — pressure and temperature (in Kelvin) are directly proportional. Heat gas in a rigid container and pressure increases.
Worked Example — Combined Gas Law (solving for V₂)
- Given: P₁=1.5 atm, V₁=4.0 L, T₁=300 K, P₂=2.0 atm, T₂=350 K; find V₂
- Combined gas law: P₁V₁/T₁ = P₂V₂/T₂ → rearrange: V₂ = P₁V₁T₂/(P₂T₁)
- V₂ = (1.5)(4.0)(350) / (2.0)(300) = 2100 / 600 = 3.50 L
- Verify: P₁V₁/T₁ = (1.5)(4.0)/300 = 0.02000; P₂V₂/T₂ = (2.0)(3.50)/350 = 0.02000 ✓
Worked Example — Gay-Lussac Calculator
- Given: P₁=1.0 atm, T₁=273 K, V constant, T₂=373 K; find P₂
- Gay-Lussac's law: P₂ = P₁T₂/T₁ = (1.0)(373)/(273) = 1.366 atm
Worked Example — Boyle's Law (pressure and volume)
- Given: P₁=1.0 atm, V₁=10.0 L, T constant, P₂=3.0 atm; find V₂
- Boyle's law: V₂ = P₁V₁/P₂ = (1.0)(10.0)/(3.0) = 3.33 L
Gas Constant R — Values in Different Units
The gas constant R represents the same physical relationship regardless of units — only its numerical value changes to match the unit system. R = 0.082057 L·atm/(mol·K) is the most frequently used value in chemistry when pressure is measured in atmospheres and volume in liters. In SI units, R = 8.31446 J/(mol·K) = 8.31446 Pa·m³/(mol·K).
Critical rule: always match R's units to your pressure and volume units. Using R=8.314 (kPa·L version) with pressure in atm throws your answer off by a factor of approximately 101 — this is the second most common error in ideal gas law problems after forgetting to convert temperature to Kelvin.
For individual gases in engineering applications, the specific gas constant is defined as R_specific = R_universal / M_molar. For example: the specific gas constant of air is 287.058 J/(kg·K); the helium gas constant (specific) is 2077.1 J/(kg·K); the gas constant for oxygen is 259.84 J/(kg·K); the gas constant for CO₂ is 188.92 J/(kg·K); the gas constant for hydrogen is 4124.2 J/(kg·K); and the gas constant for argon is 208.13 J/(kg·K). These chemistry constants are all derivable from R_universal = 8.31446 J/(mol·K) and the molar mass of each gas.
Molar Mass of a Gas — M = mRT/(PV)
Starting from the ideal gas law PV=nRT and substituting n = m/M (moles = mass divided by molar mass), we derive: M = mRT/(PV). This molar mass formula lets chemists identify an unknown gas by simply measuring its mass, pressure, volume, and temperature in Kelvin.
The related gas density formula ρ = PM/(RT) gives the density of any known gas at any conditions. These are the most powerful applications of the ideal gas law PV=nRT beyond simple single-variable solving.
Worked Example — Molar Mass of a Gas (Identifying O₂)
- Given: m = 1.60 g, P = 1.00 atm, V = 1.122 L, T = 0°C = 273.15 K
- M = mRT/(PV) = (1.60)(0.082057)(273.15) / (1.00)(1.122)
- Numerator: 1.60 × 0.082057 × 273.15 = 35.86
- Denominator: 1.00 × 1.122 = 1.122
- M = 35.86 / 1.122 = 31.96 g/mol → matches Oxygen (O₂, M = 32.00 g/mol) ✓
Non-Ideal Gases — Van der Waals Equation
Real gases deviate from the ideal gas law PV=nRT under conditions of high pressure or low temperature. The Van der Waals equation for non-ideal gases, (P + an²/V²)(V − nb) = nRT, corrects for two physical effects that the ideal gas law ignores:
- The a term (an²/V²) corrects for intermolecular attractive forces between molecules. In a non-ideal gas, attractive forces reduce the effective pressure below what the ideal gas law predicts. The larger the value of a, the stronger the intermolecular attractions and the greater the deviation from ideal behavior.
- The b term (nb) corrects for the finite volume that gas molecules physically occupy. The effective free volume available to molecules is (V − nb), not the full container volume V. In an ideal gas, molecules are treated as point masses with zero volume.
The difference between ideal gas and non-ideal gas behavior is largest at high pressure (where molecules are forced close together) and low temperature (near condensation, where attractive forces dominate). Helium (a = 0.0341 L²·atm/mol²) is the most ideal of all real gases. Water vapor (a = 5.536 L²·atm/mol²) is the most non-ideal due to strong hydrogen bonding between molecules.
Worked Example — Van der Waals for CO₂
- CO₂: a = 3.640 L²·atm/mol², b = 0.04267 L/mol; n=1 mol, V=1 L, T=300 K
- Ideal gas: P_ideal = nRT/V = (1)(0.082057)(300)/1 = 24.62 atm
- Van der Waals: P = nRT/(V−nb) − an²/V²
- Volume correction: V − nb = 1.0 − (1)(0.04267) = 0.9573 L
- Pressure correction: an²/V² = (3.640)(1)²/(1)² = 3.640 atm
- P_VdW = (1)(0.082057)(300)/0.9573 − 3.640 = 25.73 − 3.640 = 22.09 atm
- Deviation: −10.3% — CO₂'s strong intermolecular attractions reduce pressure below ideal
Gas Laws Cheat Sheet — All Formulas
The complete gas laws cheat sheet is available in the Reference tab above. It includes all gas law formulas (Boyle's, Charles's, Gay-Lussac's, Avogadro's, combined, and ideal gas law), the gas constant R in six unit systems, specific gas constants for ten gases, Van der Waals constants, and standard condition definitions (STP, SATP, NTP).
The gas law triangle (PVT triangle) is a useful memory tool: place P, V, T at the three corners. Cover the unknown corner and the visible pair shows the relationship — inversely proportional (Boyle's) when T is covered, directly proportional for the other two pairs.
Common Mistakes in Ideal Gas Law Problems
- Forgetting to convert temperature to Kelvin (most common): Using T=25 instead of T=298.15 in PV=nRT gives an answer that is 298.15/25 = 11.9 times too small — and nothing in the output flags this as wrong because the calculation still produces a number. Always: T(K) = T(°C) + 273.15.
- Using the wrong R value: Using R=8.314 with pressure in atm gives an answer off by a factor of ~101. R = 8.314 L·kPa/(mol·K) requires pressure in kPa. R = 0.082057 L·atm/(mol·K) requires pressure in atm. Always match R to your pressure and volume units.
- Wrong volume units — mL instead of L: If volume is given in mL, divide by 1000 to get liters before using PV=nRT. Using 500 mL instead of 0.500 L gives an answer 1000 times wrong.
- Forgetting Kelvin in the combined gas law: Even when temperature seems to cancel in ratios, Celsius ratios are NOT equal to Kelvin ratios. V₁/T₁ = V₂/T₂ requires T in Kelvin. Using 0°C and 100°C as 0 and 100 (instead of 273.15 and 373.15 K) gives a completely wrong ratio.
- Applying PV=nRT where it fails: At high pressure or near condensation temperature, the ideal gas law PV=nRT gives significantly wrong answers. Use the Van der Waals equation for CO₂, water vapor, ammonia, or any gas under high pressure.
Worked Examples — 8 Complete Ideal Gas Law Problems
1. Find P: n=2.5 mol, T=25°C, V=10.0 L
- Convert T: 25°C + 273.15 = 298.15 K
- PV=nRT → P = nRT/V = (2.5)(0.082057)(298.15)/10.0
- P = 61.22/10.0 = 6.122 atm = 620.4 kPa
2. Find V at STP (old): n=1 mol, P=1 atm, T=0°C
- Convert T: 0°C + 273.15 = 273.15 K
- V = nRT/P = (1)(0.082057)(273.15)/1.0 = 22.414 L
- This is the classic STP molar volume — every mole of ideal gas occupies 22.414 L at 0°C, 1 atm
3. Find n: P=2 atm, V=5 L, T=300 K
- T already in Kelvin: 300 K
- n = PV/(RT) = (2)(5)/[(0.082057)(300)] = 10/24.617 = 0.4063 mol
4. Combined gas law: P₁=1.5 atm, V₁=4 L, T₁=300 K → P₂=2 atm, T₂=350 K, find V₂
- V₂ = P₁V₁T₂/(P₂T₁) = (1.5)(4)(350)/[(2)(300)] = 2100/600 = 3.50 L
5. Boyle's Law: P₁=1 atm, V₁=10 L, T constant, P₂=3 atm, find V₂
- P₁V₁ = P₂V₂ → V₂ = P₁V₁/P₂ = (1)(10)/(3) = 3.33 L
6. Gay-Lussac's Law: P₁=1 atm, T₁=273 K, V constant, T₂=373 K, find P₂
- P₁/T₁ = P₂/T₂ → P₂ = P₁T₂/T₁ = (1)(373)/(273) = 1.366 atm
7. Molar mass: m=1.60 g, P=1 atm, V=1.122 L, T=0°C → identify gas
- T = 0 + 273.15 = 273.15 K
- M = mRT/(PV) = (1.60)(0.082057)(273.15)/(1.0)(1.122) = 35.86/1.122 = 31.96 g/mol → Oxygen O₂
8. Van der Waals CO₂: n=1 mol, V=1 L, T=300 K
- P_ideal = nRT/V = (1)(0.082057)(300)/1 = 24.62 atm
- P_VdW = nRT/(V−nb) − an²/V² = 24.62/0.9573 − 3.640 = 25.73 − 3.640 = 22.09 atm
- Deviation = −10.3% — real CO₂ has lower pressure than ideal gas law PV=nRT predicts
Frequently Asked Questions
Related Calculators
Share This Calculator
Share the Ideal Gas Law Calculator — PV=nRT!
Shahid Ali
Shahid Ali is the creator and lead developer of SciSolveLab, a platform dedicated to making complex scientific and mathematical computations accessible. With a deep background in physics, thermodynamics, and wave mechanics, Shahid's work is driven by the belief that robust, accurate mathematical tools should be just a click away for students, engineers, and researchers.