Ideal Gas Law Calculator
Solve the ideal gas equation PV = nRT for whichever variable you need — pressure, volume, temperature, or moles — given the other three. The foundational equation for any gas-phase chemistry or thermodynamics problem at moderate temperatures and pressures.
Last updated: May 2026
Compare with similar
About this calculator
The ideal gas law combines Boyle’s law, Charles’s law, Gay-Lussac’s law, and Avogadro’s law into a single equation: PV = nRT, where P is pressure, V is volume, n is moles, R is the universal gas constant, and T is absolute temperature in Kelvin (always). Rearranging gives any of the four variables: P = nRT/V, V = nRT/P, T = PV/(nR), n = PV/(RT). The gas constant R takes different numerical values depending on units: R = 0.08206 L·atm·mol⁻¹·K⁻¹ for chemistry (L and atm), R = 8.314 J·mol⁻¹·K⁻¹ for SI (m³ and Pa), R = 62.36 L·Torr·mol⁻¹·K⁻¹ for vacuum work. Choose the R whose units match your P and V inputs, or the answer will be off by orders of magnitude. The ‘ideal gas’ model assumes (1) gas molecules have negligible volume compared to the container, (2) no intermolecular forces between molecules, (3) all collisions are perfectly elastic, and (4) molecules move randomly and follow Newton’s laws. These hold well at low pressures and high temperatures, where molecules are far apart and moving fast. Edge cases: at high pressures (above ~10 atm) and temperatures near condensation, real gases deviate and require the van der Waals equation (P + a/V²)(V − b) = nRT or more complex equations of state (Peng-Robinson, Redlich-Kwong). At very low temperatures gases liquefy and the model fails. Negative temperatures in Kelvin are unphysical — always convert Celsius (T_K = T_C + 273.15) before plugging in; entering Celsius directly produces wrong (sometimes negative) results.
How to use
Example 1 — Moles in a tank of compressed gas. A 50 L gas cylinder holds gas at 200 atm and 25 °C. Convert temperature: 25 + 273.15 = 298.15 K. Use R = 0.08206 L·atm/(mol·K) to match atm and L. n = PV/(RT) = (200 × 50)/(0.08206 × 298.15) = 10,000/24.466 ≈ 408.7 mol. ✓ Set solveFor = ‘moles’, P = 200, V = 50, T = 298.15, R = 0.08206. If this is oxygen (MW 32), that is 408.7 × 32 = 13,078 g ≈ 13.1 kg of compressed O₂. Example 2 — Volume change at high altitude. A weather balloon contains 1.5 mol of helium at sea level (1.0 atm, 20 °C = 293.15 K). At 20,000 m altitude T drops to −56 °C = 217.15 K and P to 0.055 atm. V = nRT/P at the new conditions: V = (1.5 × 0.08206 × 217.15)/0.055 = 26.73/0.055 ≈ 486 L. ✓ At sea level the same gas occupied V₀ = (1.5 × 0.08206 × 293.15)/1.0 ≈ 36.1 L. The balloon expands by a factor of ~13.5 — mostly because pressure drops by ~18× but temperature also drops, partially offsetting. This is exactly why weather balloons are launched with much less helium than they appear to need.
Frequently asked questions
When does the ideal gas law actually apply?
The ideal gas model holds best at low pressures (typically under 1–10 atm) and temperatures well above the gas’s condensation point. At STP (1 atm, 273 K) most common gases — N₂, O₂, He, H₂ — agree with the ideal law to within 0.1%. Deviations grow as pressure increases (molecules forced close enough that their volume matters) and as temperature drops (intermolecular attractions become non-negligible). At ~100 atm or near boiling point, deviations can exceed 10%. Polar gases (water vapour, ammonia) and large molecules (butane, propane) deviate more than non-polar small molecules (He, Ar). For atmospheric chemistry, basic stoichiometry, gas-phase reaction stoichiometry, and most chemistry homework problems, ideal-gas assumptions are fine. For industrial processes at high pressure (Haber process for ammonia, petroleum refining) or cryogenic conditions, real-gas equations like van der Waals or Peng-Robinson are needed.
Why must temperature be in Kelvin?
The ideal gas law is derived from the kinetic theory of gases, where temperature represents the average translational kinetic energy of molecules: (3/2)k_B·T per molecule. Kinetic energy is non-negative, so the temperature in this expression must be on an absolute scale that starts at zero kinetic energy — that is exactly what Kelvin is, with 0 K corresponding to (theoretical) zero molecular motion. Celsius and Fahrenheit are arbitrary scales: 0 °C corresponds to water’s freezing point, not to zero molecular activity. If you plug 0 °C into PV = nRT you would predict zero pressure or zero volume, which is obviously wrong for an actual gas at the freezing point of water. Always convert: T(K) = T(°C) + 273.15, or T(K) = (T(°F) − 32) × 5/9 + 273.15. The 273.15 offset is exact by definition (since the 2019 SI redefinition fixed the Boltzmann constant).
What does the gas constant R actually represent?
R is a proportionality constant linking universal gas behaviour to the units chosen for P, V, and T. It can be expressed as R = N_A × k_B, where N_A is Avogadro’s number (6.022 × 10²³) and k_B is Boltzmann’s constant (1.381 × 10⁻²³ J/K). Multiplying these gives 8.314 J/(mol·K) in SI units. The other values of R you will see — 0.08206 L·atm/(mol·K), 62.36 L·Torr/(mol·K), 1.987 cal/(mol·K) — are the same physical constant expressed in different unit systems. Choose the form that matches your P and V units, and the math works out without unit conversions. Mismatching R with the other units is one of the most common bugs in gas-law calculations; an order-of-magnitude error usually means you used the wrong R. The SI value 8.314 J/(mol·K) is exact since 2019, as the kelvin is now defined by fixing k_B.
What are the most common mistakes people make with PV = nRT?
The first is using Celsius instead of Kelvin — the single most common error and produces obviously wrong or negative answers. Always convert. The second is mismatching units between P, V, and R — pressure in atm with R in J/(mol·K) (which assumes Pa) will be off by a factor of ~10⁵. Pick a consistent unit system and stick to it. The third is forgetting that ‘STP’ is no longer 1 atm, 0 °C in modern IUPAC convention — since 1982 IUPAC defines STP as 1 bar (= 0.987 atm) and 0 °C, slightly different from the older 1 atm definition. Older textbooks often use the older value. The fourth is applying ideal-gas math to mixtures without using partial pressures (Dalton’s law): each component contributes its own partial pressure, and total P is the sum. The fifth is using the formula at high pressures or near condensation where real-gas behaviour deviates significantly; the calculator returns a number, but it can be off by 10% or more from reality.
When should I not use this calculator?
Skip it for high-pressure gas behaviour (above ~10–20 atm depending on the gas) where van der Waals or Peng-Robinson equations are needed for accuracy. Avoid it for gases near or below their boiling point, where the ideal-gas approximation fails and you may need to account for partial condensation. It is the wrong tool for liquids or solids — only gases obey PV = nRT. For mixtures of gases, the law applies to each component using partial pressures, but a single PV = nRT calculation for ‘the mixture’ obscures the per-component information that drives chemistry. Skip it for supercritical fluids (high pressure and temperature simultaneously) where equation-of-state choices matter and a single ideal result is misleading. And for problems requiring high precision in pharmacology, atmospheric chemistry, or precision metrology, use a real-gas equation of state appropriate to the conditions; the ideal-gas law is a starting estimate, not a definitive answer for those domains.