Ideal Gas Law Calculator
Calculate pressure, volume, temperature, or moles. PV = nRT
We use cookies for analytics and advertising. Learn more about our cookie policy
Last updated: 23 August 2026
Reviewed by Gavin Meiring, Lead research and primary author · Doctoral Candidate (Corporate Governance) · Research and drafting assisted by AI
Calculate pressure, volume, temperature, or moles. PV = nRT
The ideal gas law calculator solves for any one of the four variables in the equation PV = nRT, pressure, volume, amount of substance, or temperature, given the other three. It is used in chemistry and physics classrooms, by chemical engineers sizing reactors and pipelines, by scuba divers calculating air consumption and tank fills, by meteorologists working with atmospheric pressure profiles, by HVAC technicians sizing ducts and refrigerant lines, and by anyone working with gases under controlled conditions. The ideal gas law is the simplest model that captures the broad behaviour of real gases at moderate temperatures and pressures, and it remains the starting point for almost every quantitative gas problem.
The ideal gas law in its standard form is:
P × V = n × R × T
Where:
Rearranged to solve for each variable:
P = nRT / V
V = nRT / P
n = PV / RT
T = PV / (nR)
The gas constant R has different numerical values depending on the units used for pressure and volume:
Always check that R, P, V, and T are in mutually consistent units.
Example 1, Tank volume from mass of gas
A 5.00 g sample of nitrogen gas (N₂, molar mass 28.02 g/mol) is held in a container at 1.00 atm and 25.0 °C. What is the container volume?
n = 5.00 g / 28.02 g/mol = 0.1785 mol T = 25.0 + 273.15 = 298.15 K V = nRT / P = (0.1785 × 0.08206 × 298.15) / 1.00 ≈ 4.37 L
Example 2, Pressure in a heated container
A 2.50 L rigid container holds 0.150 mol of helium at 25.0 °C. The container is heated to 200 °C. What is the new pressure?
At 25 °C: P₁ = nRT₁ / V = (0.150 × 0.08206 × 298.15) / 2.50 ≈ 1.467 atm At 200 °C (473.15 K): P₂ = (0.150 × 0.08206 × 473.15) / 2.50 ≈ 2.330 atm
The pressure rises in proportion to absolute temperature (Gay-Lussac's law): 473.15 / 298.15 = 1.587, and 1.467 × 1.587 = 2.327 atm (small rounding difference).
Example 3, Stoichiometric gas yield
The reaction CaCO₃ → CaO + CO₂ produces carbon dioxide gas. How many litres of CO₂ at STP (1.00 atm, 273.15 K) are released when 100 g of calcium carbonate decompose?
n = 100 g / 100.09 g/mol = 0.999 mol ≈ 1.00 mol V = nRT / P = (1.00 × 0.08206 × 273.15) / 1.00 ≈ 22.4 L
This is the famous molar volume of an ideal gas at STP: 22.4 L per mole.
Example 4, Scuba tank air calculation
A 12 L scuba tank is filled to 200 bar (≈197 atm) at 25 °C. How many moles of air does it contain, and how many litres would that air occupy at surface pressure (1 atm)?
n = PV / RT = (197 × 12) / (0.08206 × 298.15) ≈ 96.6 mol of air
At the surface: V = nRT / P = 96.6 × 0.08206 × 298.15 / 1.00 ≈ 2,360 L
So a full 12 L scuba tank holds enough air to fill roughly 2,360 L at the surface, enough for about an hour of moderate diving at the surface.
The ideal gas law assumes that gas molecules have zero volume and exert no forces on each other except through perfectly elastic collisions. Real gases approximate this behaviour when:
The law breaks down near the condensation point, at high pressure, and for strongly polar or hydrogen-bonding gases (water vapour, ammonia). For those cases, the van der Waals equation or one of several other equations of state is used:
(P + a(n/V)²)(V − nb) = nRT
Where a and b are substance-specific constants. For water vapour at 1 atm and 100 °C, the ideal gas law overestimates pressure by about 5%.
Many practical problems involve changes in pressure, volume, and temperature while the amount of gas stays constant. The combined gas law is:
P₁V₁ / T₁ = P₂V₂ / T₂
This is the ideal gas law with n and R factored out. It covers the three classical "gas laws":
Using temperature in Celsius instead of Kelvin. The gas law requires absolute temperature. Plugging in 25 °C instead of 298.15 K produces wildly wrong results. Always convert °C to K by adding 273.15.
Pressure in gauges instead of absolute. Most pressure gauges read gauge pressure (above atmospheric) or below. The gas law requires absolute pressure. To convert: P_absolute = P_gauge + P_atmospheric. For a 30 psi gauge reading at sea level: 30 + 14.7 = 44.7 psia.
Mixing units of R with different pressure units. R = 0.08206 L·atm/(mol·K) requires P in atm. If your pressure is in kPa, use R = 8.314 (kPa·L)/(mol·K) or convert kPa to atm first (1 atm = 101.325 kPa).
Forgetting that STP has changed. The historical STP (Standard Temperature and Pressure) is 0 °C and 1 atm, giving 22.4 L/mol. Modern IUPAC STP is 0 °C and 1 bar (100 kPa), giving 22.7 L/mol. Many textbook tables still use the older value.
What is an ideal gas? An ideal gas is a theoretical gas whose molecules occupy negligible space and have no intermolecular forces. Real gases approach ideal behaviour at low pressure and high temperature. The ideal gas law (PV = nRT) describes the behaviour of all real gases approximately; more accurate equations of state (van der Waals, Redlich-Kwong, Peng-Robinson) are used near the condensation point or at very high pressure.
Why must temperature be in kelvins? The gas law arises from a direct proportionality between average molecular kinetic energy and absolute temperature. Negative absolute temperatures would imply negative kinetic energy, which is unphysical. The kelvin scale starts at absolute zero (0 K = −273.15 °C), where all thermal motion ceases. Using Celsius in the gas law gives meaningless negative volumes or pressures.
What is the gas constant R? R = 8.314 J/(mol·K) in SI units. It connects macroscopic gas behaviour to the Boltzmann constant and Avogadro's number. R appears in the ideal gas law, the Arrhenius equation, the Nernst equation, and many other physical chemistry formulas.
At what conditions is the ideal gas law accurate? Generally, when the pressure is below about 10 atm and the temperature is well above the critical temperature of the gas. For air, nitrogen, oxygen, and similar gases, the law is accurate to within a few percent at standard conditions. For steam, ammonia, carbon dioxide, and other easily-condensed gases, real-gas corrections are needed even at modest pressures.
How does the ideal gas law relate to Boyle's, Charles's, and Gay-Lussac's laws? These three classical laws are special cases of the ideal gas law when one variable is held constant. Boyle's law (PV = constant, T constant) governs breathing, syringe operation, and many industrial processes. Charles's law (V/T = constant, P constant) governs hot-air balloons and most gas thermometers. Gay-Lussac's law (P/T = constant, V constant) governs pressure-cooker operation and aerosol cans.
What is partial pressure (Dalton's law)? In a mixture of non-reacting gases, the total pressure equals the sum of the partial pressures: P_total = P₁ + P₂ + ... Each gas obeys the ideal gas law independently, with its own partial pressure proportional to its mole fraction. Dalton's law is essential in diving (partial pressures of O₂, N₂, and contaminants), in anaesthesia, and in atmospheric science.
What is the molar volume of an ideal gas at STP? At historical STP (0 °C, 1 atm), the molar volume is 22.414 L/mol. At modern IUPAC STP (0 °C, 1 bar), it is 22.711 L/mol. At 25 °C and 1 atm (often called "standard ambient"), the molar volume is 24.466 L/mol.
Why does a weather balloon expand as it rises? A weather balloon carries a fixed mass of gas (typically helium) as it ascends. Atmospheric pressure decreases with altitude (roughly halving every 5,500 m), and temperature also falls. Combined gas law: V increases as P decreases, which is why weather balloons are only partially inflated at launch, they expand enormously by the time they reach the stratosphere.
**Q:**Can the Ideal Gas Law Calculator be used for professional or commercial purposes?A: Yes, the Ideal Gas Law Calculator The Ideal Gas Law Calculator provides mathematically correct results that are suitable for professional, commercial, and educational use. the Ideal Gas Law Calculator formulas used are well-established and validated against reference standards.
**Q:**How often are the formulas behind the Ideal Gas Law Calculator updated? When standards change (e.g., new physical constants, revised tax brackets, updated standards), the Ideal Gas Law Calculator is updated to reflect the current authoritative source. Each calculator's references section, including the Ideal Gas Law Calculator, lists the specific sources used.