Ideal Gas Law (PV = nRT)
The ideal gas law connects pressure, volume, amount of gas, and temperature through a single equation. If you know any three of these quantities you can solve for the fourth. The universal gas constant R equals 0.08206 L·atm/(mol·K) when using atmospheres and liters, or 8.314 J/(mol·K) in SI units.
P = nRT / V
Density Form of the Ideal Gas Law
The density form replaces moles with density and a specific gas constant, making it useful when working with mass instead of moles. All values are in SI units: pascals, kg/m³, J/(kg·K), and kelvin.
ρ = P / (R_specific × T)
Boyle’s Law (P₁V₁ = P₂V₂)
Boyle’s law is a special case of the ideal gas law that applies when temperature and the amount of gas are constant. It states that pressure and volume are inversely proportional: compressing a gas to half its volume doubles its pressure.
P₁V₁ = P₂V₂
How It Works
The ideal gas law PV = nRT connects pressure, volume, amount of gas, and temperature through a single equation. If you know any three of these quantities you can solve for the fourth. The calculator also supports a density form for working with mass instead of moles, and Boyle’s law for constant-temperature processes. The universal gas constant R equals 0.08206 L·atm/(mol·K) when using atmospheres and liters, or 8.314 J/(mol·K) in SI units. Temperature must always be in kelvin (absolute) for gas law calculations.
Example Problem
A 2.0 mol sample of nitrogen gas is held in a 10.0 L container at 300 K. What is the pressure?
- Write the ideal gas law: P = nRT / V
- Substitute values: P = (2.0)(0.08206)(300) / 10.0
- Result: P ≈ 4.92 atm
For Boyle’s law: if a gas at 2 atm occupies 5 L, compressing it to 2 L at constant temperature gives P₂ = (2 × 5) / 2 = 5 atm.
When to Use Each Variable
- Solve for Pressure — when you know volume, moles, and temperature, e.g., finding the pressure in a sealed container at a given temperature.
- Solve for Volume — when you know pressure, moles, and temperature, e.g., determining the volume a gas occupies at STP.
- Solve for Moles — when you know pressure, volume, and temperature, e.g., calculating the amount of gas in a container.
- Solve for Temperature — when you know pressure, volume, and moles, e.g., finding the temperature needed to achieve a target pressure.
- Solve for Density — when you know pressure, specific gas constant, and temperature, e.g., calculating air density at altitude.
- Solve for P₁ (Boyle's Law) — when you know the final state and initial volume at constant temperature, e.g., finding the starting pressure before compression.
Key Concepts
The ideal gas law PV = nRT connects four state variables through the universal gas constant R. Temperature must always be in kelvin (absolute scale) because gas properties are proportional to molecular kinetic energy. The law assumes gas molecules have negligible volume and no intermolecular forces — it works well at moderate pressures and temperatures but breaks down near condensation points or above ~10 atm.
Applications
- Chemistry: predicting gas behavior in reactions, including volume changes and pressure buildup
- Aerospace engineering: calculating air density at different altitudes for lift and drag analysis
- HVAC design: sizing ductwork and determining air volumes at different temperatures and pressures
- Scuba diving: calculating tank pressure changes with depth and temperature using Boyle's and the ideal gas law
- Industrial processes: designing pressure vessels and gas storage systems
Common Mistakes
- Using Celsius or Fahrenheit instead of kelvin — gas law equations require absolute temperature
- Applying the ideal gas law at very high pressures — above ~10 atm, use van der Waals or another real gas equation
- Mixing unit systems — R has different values depending on whether you use atm/L or Pa/m³
- Forgetting that Boyle's law requires constant temperature — if temperature changes, use the full ideal gas law instead
Frequently Asked Questions
What is the ideal gas law formula?
The ideal gas law is PV = nRT, where P is pressure, V is volume, n is the number of moles, R is the gas constant, and T is absolute temperature in kelvin. It assumes gas molecules have negligible volume and no intermolecular forces.
When does the ideal gas law not work?
The ideal gas law becomes inaccurate at very high pressures (above ~10 atm) or very low temperatures near a gas’s condensation point. Under those conditions, intermolecular forces and molecular volume matter, and equations like the van der Waals equation give better results.
Why must temperature be in kelvin for gas laws?
Gas law equations require absolute temperature because pressure and volume are proportional to the thermal energy of the gas molecules. Zero kelvin represents zero molecular kinetic energy. Using Celsius or Fahrenheit would produce incorrect results because those scales have arbitrary zero points.
What is the difference between Boyle’s law and the ideal gas law?
Boyle’s law (P₁V₁ = P₂V₂) is a special case of the ideal gas law that applies when temperature and the amount of gas are constant. The full ideal gas law covers any combination of changing pressure, volume, moles, and temperature.
How do you calculate moles of a gas from pressure and volume?
Rearrange the ideal gas law to n = PV / (RT). For example, a gas at 1 atm in a 22.4 L container at 273.15 K contains about 1 mol — this is the standard molar volume at STP.
Reference: Tipler, Paul A. 1995. Physics For Scientists and Engineers. Worth Publishers. 3rd ed. Lindeburg, Michael R. 1992. Engineer In Training Reference Manual. Professional Publication, Inc. 8th ed.
Related Calculators
- Specific Gas Constant Calculator — find the gas constant for a particular gas from its molecular weight.
- Temperature Conversion Calculator — convert between Celsius, Fahrenheit, Kelvin, and Rankine.
- Thermal Expansion Calculator — calculate how materials expand or contract with temperature changes.
- Thermal Diffusivity Calculator — compute heat diffusion rate for gases and solids.
- Density Equation Calculator — find gas density from mass and volume.
- Pressure Unit Converter — convert between atm, Pa, psi, and other pressure units.
Related Sites
- CameraDOF — Depth of field calculator for photographers
- Medical Equations — Clinical and medical calculators
- Dollars Per Hour — Weekly paycheck calculator with overtime
- InfantChart — Baby and child growth percentile charts
- Z-Score Calculator — Z-score to probability and percentile calculator
- LoanChop — Loan prepayment and extra payment calculator