Ideal Gas Law Calculator

Solve for Pressure (P), Volume (V), Moles (n), or Temperature (T) using the universal gas law. Interactive PV isotherm graph, real‑time validation, and detailed step‑by‑step derivation.

Universal gas constant R = 0.082057 L·atm/(mol·K). Ensure consistent units: atm, Liters, mol, Kelvin.
?️ STP (0°C, 1 atm): n=1 → V=22.414 L
? RTP (25°C, 1 mol, 1 atm) → V=24.466 L
? Balloon: V=2.5 L, n=0.1 mol, T=300K → P=0.984 atm
? Scuba tank: P=200 atm, V=12 L, T=295K → n=99.1 mol
? Combustion: n=0.5 mol, T=400K, V=10 L → P=1.64 atm
Privacy-first & academic integrity: All calculations and graph rendering occur locally in your browser. No data is transmitted or stored.

The Ideal Gas Law: Foundation of Thermodynamics

The ideal gas law (PV = nRT) combines Boyle's, Charles's, and Avogadro's laws into a single elegant equation. It describes the behavior of hypothetical ideal gases — particles with negligible volume and no intermolecular forces. Although no real gas is perfectly ideal, the law provides remarkable accuracy at high temperatures and low pressures, serving as the cornerstone of chemical engineering, meteorology, and astrophysics.

PV = nRT

Where: P = absolute pressure (atm), V = volume (L), n = amount of substance (mol), T = absolute temperature (K), R = universal gas constant (0.082057 L·atm·mol⁻¹·K⁻¹).

Historical & Scientific Authority

Empirical gas laws emerged in the 17th–19th centuries: Robert Boyle (1662, P ∝ 1/V), Jacques Charles (1787, V ∝ T), and Amedeo Avogadro (1811, V ∝ n). The unified equation was formulated by Émile Clapeyron in 1834. The constant R was later determined accurately by Henri Victor Regnault. Modern metrology defines R = 8.314462618 J/(mol·K) in SI, but the 0.082057 L·atm/(mol·K) variant remains standard in chemistry labs worldwide. The ideal gas law also laid the groundwork for the kinetic molecular theory and statistical mechanics.

Why Use This Interactive Solver?

  • Pedagogical power: Instantly see how changing any variable affects the others. The dynamic PV isotherm reinforces Boyle's law intuition.
  • Laboratory companion: Quickly determine unknown quantities in gas stoichiometry, syringe experiments, or closed‑vessel reactions.
  • Engineering design: Size pressure vessels, estimate gas storage requirements, or model pneumatic systems.
  • Climate & atmosphere: Understand air parcel behavior, lapse rates, and balloon ascent using ideal gas approximations.

Derivation & Mathematical Workflow

Given three known quantities, we isolate the unknown using algebraic rearrangement:

  • Pressure: P = (nRT) / V
  • Volume: V = (nRT) / P
  • Moles: n = (PV) / (RT)
  • Temperature: T = (PV) / (nR)

Our algorithm first checks exactly one missing field among the four. If the temperature is entered in Celsius, it’s converted to Kelvin (K = °C + 273.15). Absolute zero constraints are enforced: T must be > 0 K, and n, P, V must be positive. After solving, the program verifies consistency with the ideal gas ratio PV/(nRT) — which should be 1 (within floating tolerance). The interactive PV diagram draws an isotherm based on the current n and T (if available; otherwise default n=1, T=298K) and highlights the (P,V) coordinate if both are present.

Step‑by‑Step Problem Solving Example

Example: A 4.0 L container holds 0.25 mol of helium at 300 K. What is the pressure?
Solution: P = nRT/V = (0.25 mol × 0.082057 × 300 K) / 4.0 L = (6.154275)/4 = 1.5386 atm.
Our calculator returns P = 1.5386 atm, and the PV graph displays the isotherm with the corresponding point.

Limitations & Real‑Gas Deviations

At high pressures (>10 atm) or near condensation temperatures, intermolecular forces and molecular volume cause deviations. The van der Waals equation (P + a(n/V)²)(V - nb) = nRT corrects for these effects. However, for most educational and many engineering contexts (air at ambient conditions, noble gases, combustion exhaust), the ideal gas law yields error < 1–2%.

Gas (1 atm, 273K) Ideal Molar Volume (L) Real Molar Volume (L) Deviation %
Helium 22.414 22.426 +0.05%
Nitrogen 22.414 22.402 -0.05%
Carbon Dioxide 22.414 22.263 -0.67%
Water Vapour (373K) 30.62 30.19 -1.4%
Real‑world application: Diving cylinder sizing

A scuba tank stores air at 200 atm and 12 L. At 295 K, the moles of air: n = PV/(RT) = (200 × 12) / (0.082057 × 295) ≈ 99.1 mol. Using the ideal gas law, the diver can estimate the equivalent surface volume (≈ 2400 L at 1 atm). This calculation is critical for dive planning and safety. The interactive calculator above reproduces this instantly using the “scuba” preset.

Frequently Asked Questions

We use standard chemistry units: atmospheres (atm) for pressure, liters (L) for volume, moles (mol) for amount, and Kelvin (K) for temperature. The gas constant R = 0.082057 L·atm/(mol·K). If your data is in different units (e.g., Pa or m³), convert beforehand or use the appropriate R value.

Absolute temperature must be positive (Kelvin). Negative or zero Kelvin is physically impossible. If you input Celsius below -273.15°, the solver will reject it. Always use the Celsius checkbox to convert correctly.

The solver expects exactly three inputs. If all four are provided, the calculator will not know which variable to compute. Leave exactly one field blank (empty) to solve for it. The system will highlight the missing field.

Yes — for gas mixtures, the ideal gas law applies to the total number of moles. For example, dry air (molar mass ~28.97 g/mol) obeys PV = nRT with good accuracy up to moderate pressures.

The isotherm curve P = nRT / V depends on n and T. If both are provided, the graph uses your actual n,T for an accurate representation. If either is missing, it uses default n=1, T=298 K to illustrate Boyle's law shape. The red dot shows your current (P,V) point if both exist.

This tool follows IUPAC recommendations for gas constant usage and numerical precision. The underlying formulas are cross‑checked against standard textbooks (Atkins’ Physical Chemistry, 11th ed.; Moran’s Fundamentals of Engineering Thermodynamics). Regular updates ensure compliance with metrological standards. Last verification: June 2026.

Ideal for classroom demonstrations, lab calculations, and self‑study. Backed by the GetZenQuery tech team.

References: CODATA recommended values of R; IUPAC Gold Book – Ideal Gas; Wikipedia contributors. "Ideal gas law." Wikipedia, The Free Encyclopedia.