Ideal Gas Law Calculator
Calculator
Solve PV = nRT for pressure, volume, moles or temperature.
About the Ideal Gas Law
PV = nRT relates pressure (P), volume (V), moles (n), and temperature (T). The gas constant R = 0.082057 L·atm·K⁻¹·mol⁻¹ is derived from the CODATA value 8.314462618 J·K⁻¹·mol⁻¹. At STP (0°C, 1 atm) one mole of an ideal gas occupies 22.414 L. Pressure is always absolute, never gauge.
About This Tool
Understanding the Ideal Gas Law
The Ideal Gas Law is one of the most fundamental equations in chemistry and physics, describing the behavior of gases under varying conditions. Expressed as PV = nRT, it relates four key properties: pressure (P), volume (V), amount of substance in moles (n), and temperature (T), with R being the universal gas constant. This calculator allows you to solve for any one variable when the other three are known, making it an essential tool for students, scientists, engineers, and anyone working with gases.
What Does PV = nRT Mean?
The Ideal Gas Law combines three historical gas laws into a single equation. Boyle's Law states that pressure and volume are inversely proportional at constant temperature (P₁V₁ = P₂V₂). Charles's Law shows that volume is directly proportional to temperature at constant pressure (V₁/T₁ = V₂/T₂). Avogadro's Law states that volume is proportional to the number of moles at constant temperature and pressure. The Ideal Gas Law unifies these relationships, with the gas constant R = 0.082057 L·atm·K⁻¹·mol⁻¹ serving as the proportionality factor that makes the equation work across different unit systems.
Five Calculation Modes
This calculator goes beyond a single-equation solver. Use the mode switcher above the inputs to move between five related gas calculations, each with its own step-by-step working.
- PV = nRT: solve for pressure, volume, moles or temperature from the other three.
- Density and molar mass: apply
ρ = PM/(RT)in either direction. SolvingM = ρRT/Pis the classic Dumas method for identifying an unknown gas from a measured vapour density. - Real gas: compare the ideal prediction with the van der Waals equation
(P + an²/V²)(V − nb) = nRTand read the compressibility factorZ = PV/(nRT). - Molecular speeds: kinetic molecular theory gives
v_rms = √(3RT/M),v_mean = √(8RT/πM),v_mp = √(2RT/M)and the translational kinetic energy(3/2)RTper mole. - Mixtures: build a multi-component mixture and get mole fractions and partial pressures from Dalton's law,
p_i = x_i × P_total.
Real Gases, van der Waals and the Compressibility Factor
Real molecules take up space and attract one another, so measured pressures drift away from PV = nRT. The van der Waals equation adds two corrections: b subtracts the volume the molecules themselves occupy (which raises pressure), and a accounts for intermolecular attraction (which lowers it). For 1 mol of CO₂ in 1 L at 300 K the ideal law predicts 24.6172 atm while van der Waals gives 22.0744 atm, so Z = 0.8967. That 10.33% gap is a genuine disagreement between two models, not a rounding artefact — attraction dominates for CO₂ at this state, which is why Z falls below 1. When Z exceeds 1 the molecular volume term has taken over and the gas resists compression more than the ideal law expects.
How Fast Do Gas Molecules Move?
Temperature is a statement about molecular motion, and the speeds mode makes that concrete. Nitrogen at 300 K has a most probable speed of 422.00 m/s, a mean speed of 476.17 m/s and a root-mean-square speed of 516.84 m/s — always in that order, in the fixed ratio 1 : 1.1284 : 1.2247 set by the Maxwell–Boltzmann distribution. That v_rms is about 1.5 times the 343 m/s speed of sound in air, which is precisely why a pressure disturbance travels through air as quickly as it does. Note that molar mass must be in kg/mol for these formulas; the calculator converts from g/mol for you.
When to Use the Ideal Gas Law
The Ideal Gas Law works best under conditions where gases behave ideally: relatively low pressure and high temperature. At these conditions, intermolecular forces are negligible, and the volume occupied by gas molecules themselves is insignificant compared to the container volume. Common gases like nitrogen, oxygen, hydrogen, and helium behave very close to ideal under normal atmospheric conditions (around 1 atm and room temperature). The law becomes less accurate at extremely high pressures, very low temperatures, or near the condensation point where real gas effects become significant.
Real-World Applications
- Chemistry Labs: Calculate the amount of gas produced in chemical reactions, determine molar masses of unknown gases, and predict gas behavior in experiments.
- Engineering and HVAC: Design compressed air systems, size storage tanks, calculate pressure vessel requirements, and model gas flow in pipelines.
- Meteorology: Understand atmospheric pressure changes with altitude, predict weather patterns, and model air density variations.
- Scuba Diving: Calculate air consumption rates, determine tank capacity requirements, and understand the relationship between depth, pressure, and gas volume.
- Automotive Industry: Optimize fuel injection systems, design intake manifolds, and model combustion chamber dynamics.
- Medical Applications: Calculate oxygen therapy dosages, design respiratory equipment, and understand gas exchange in lungs.
Understanding STP and Standard Conditions
Standard Temperature and Pressure (STP) is a reference point where temperature is 273.15 K (0°C) and pressure is exactly 1 atmosphere (101.325 kPa). At STP, one mole of any ideal gas occupies 22.4 liters—a fact that's incredibly useful for converting between moles and volume in chemistry calculations. This standardization allows scientists worldwide to compare experimental results consistently. The calculator includes one-click STP, SATP (298.15 K, 1 bar) and NTP (293.15 K, 1 atm) presets that fill in these standard values, making it easy to work under any of the common reference conditions.
How to Use This Calculator
Start by choosing a mode, then — in the default PV = nRT mode — select which variable you want to calculate from the dropdown menu: pressure (P), volume (V), number of moles (n), or temperature (T). The calculator will then show input fields for the remaining three variables. Enter your known values and select the appropriate units—the calculator supports multiple unit systems including atmospheres, pascals, liters, cubic meters, Kelvin, Celsius, and Fahrenheit. Temperature values are automatically converted to Kelvin internally (the required unit for gas law calculations), ensuring accurate results regardless of your input format. Click "Calculate" to see the result along with step-by-step solutions and alternative unit conversions.
Important Considerations and Limitations
Always remember that temperature in gas law calculations must be in Kelvin, never Celsius or Fahrenheit, because the equations require an absolute temperature scale starting from absolute zero. Our calculator handles this conversion automatically. Be aware that the Ideal Gas Law assumes no intermolecular forces and zero molecular volume, which isn't perfectly true for real gases. For highly accurate work with gases under extreme conditions, consider using the Van der Waals equation or other real gas equations. Additionally, water vapor and gases with strong polar interactions deviate more significantly from ideal behavior than simple diatomic gases.
Tips for Accurate Calculations
- Always double-check that your temperature is positive in Kelvin— negative Kelvin temperatures are physically impossible.
- Verify unit consistency: if using R = 0.082057 L·atm·K⁻¹·mol⁻¹, ensure volume is in liters and pressure in atmospheres.
- For chemistry problems involving gas-producing reactions, remember to balance chemical equations first to determine the correct number of moles.
- When working with gas mixtures, use Dalton's Law of Partial Pressures in conjunction with the Ideal Gas Law for each component.
- Cross-reference results using alternative units to catch potential calculation errors—our calculator shows conversions automatically.
Example Calculations
Example 1 - Finding Pressure: If you have 2 moles of gas in a 5-liter container at 298 K (25°C), what is the pressure? P = nRT/V = (2 mol)(0.082057)(298 K)/(5 L) = 9.78 atm.
Example 2 - Finding Volume: What volume does 1 mole of gas occupy at STP? V = nRT/P = (1 mol)(0.082057)(273.15 K)/(1 atm) = 22.4 L—the famous molar volume at STP!
Example 3 - Finding Moles: A 10-liter tank contains gas at 5 atm and 300 K. How many moles are present? n = PV/RT = (5 atm)(10 L)/[(0.082057)(300 K)] = 2.03 mol.
Frequently Asked Questions
Yes, Ideal Gas Law Calculator is totally free :)
Yes, you can install the webapp as PWA.
Yes, any data related to Ideal Gas Law Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.
The Ideal Gas Law is an equation that describes the relationship between pressure (P), volume (V), number of moles (n), and temperature (T) of an ideal gas. The equation PV = nRT combines Boyle's, Charles's, and Avogadro's laws, where R is the universal gas constant (0.082057 L·atm·K⁻¹·mol⁻¹). It allows you to calculate any one variable if you know the other three.
The Ideal Gas Law works best for gases at low pressure and high temperature, where intermolecular forces are negligible. It's accurate for most real gases under normal conditions (room temperature and atmospheric pressure). However, it becomes less accurate at very high pressures, very low temperatures, or near the condensation point where gases behave non-ideally.
The units depend on your gas constant (R) value. Common combinations are R = 0.0820574 L·atm·K⁻¹·mol⁻¹ (atm, L, K), R = 8.314462618 J·K⁻¹·mol⁻¹ (Pa, m³, K), and R = 62.3637 L·torr·K⁻¹·mol⁻¹ (torr, L, K). Temperature must always be absolute: add 273.15 to Celsius, or convert Fahrenheit with °C = (°F − 32) × 5/9 first, so 25°C and 77°F are both 298.15 K. This calculator handles the conversions for you, and pressure must be absolute rather than gauge.
STP stands for Standard Temperature and Pressure: 273.15 K (0°C) and 1 atm (101.325 kPa). At STP, one mole of any ideal gas occupies 22.414 liters. This standardization lets scientists compare gas properties consistently, and many chemistry problems quote gas volumes at STP. The calculator also offers SATP (298.15 K, 1 bar) and NTP (293.15 K, 1 atm) as one-click presets.
Z = PV/(nRT) measures how far a gas strays from ideal behaviour and equals exactly 1 for an ideal gas. Z below 1 means intermolecular attraction dominates, so the gas is easier to compress than the ideal law predicts; Z above 1 means the finite volume of the molecules dominates and the gas resists compression. For 1 mol of CO₂ in 1 L at 300 K the van der Waals equation gives 22.0744 atm against the ideal 24.6172 atm, so Z ≈ 0.8967 — about 10% more compressible than ideal. That gap is a genuine difference between two models, not a rounding error.
Kinetic molecular theory gives three related speeds from the same temperature and molar mass: the most probable speed v_mp = √(2RT/M), the mean speed v_mean = √(8RT/πM), and the root-mean-square speed v_rms = √(3RT/M). They always appear in that order, in the fixed ratio 1 : 1.1284 : 1.2247. Nitrogen at 300 K gives 422.00, 476.17 and 516.84 m/s — roughly 1.5 times the speed of sound in air, which is why pressure disturbances travel as quickly as they do.