Ideal Gas Law Calculator | PV=nRT
Solve PV = nRT for any unknown variable.
What Is the Ideal Gas Law Calculator | PV=nRT?
The Ideal Gas Law combines Boyle's Law (P∝1/V), Charles's Law (V∝T), and Avogadro's Law (V∝n) into one unified equation. It describes how pressure, volume, temperature, and moles of gas interrelate for an idealized gas, one with no intermolecular forces and negligible molecular volume.
- ›Solve for any variable: given three of P, V, n, T the calculator finds the fourth automatically.
- ›Unit flexibility: input pressure in Pa, kPa, atm, bar, or psi; volume in L, mL, or m³; temperature in K, °C, or °F.
- ›Van der Waals mode: accounts for real-gas behavior using species-specific constants (a, b) for gases like CO₂, NH₃, H₂O, and more.
- ›Combined Gas Law: when n is constant, the tool can also solve P₁V₁/T₁ = P₂V₂/T₂ for before-and-after scenarios.
- ›Molar mass & density: if the gas identity is known, the tool reports density (g/L) and grams per given moles.
- ›STP/SATP presets: quickly load Standard Temperature and Pressure (0°C, 1 atm) or Standard Ambient conditions (25°C, 100 kPa).
Formula
| Variable | Meaning | SI Unit |
|---|---|---|
| P | Absolute pressure | Pa (pascal) |
| V | Volume | m³ |
| n | Amount of substance | mol |
| R | Universal gas constant | 8.314 J/(mol·K) |
| T | Absolute temperature | K (kelvin) |
How to Use
- 1Choose which variable to solve for (P, V, n, or T) from the "Solve for" dropdown.
- 2Enter the known values in the three remaining fields. Select your preferred units for each.
- 3Press Calculate (or hit Enter) to see the result with full unit conversions.
- 4To model real-gas behavior, toggle "Van der Waals" and pick a gas species, the constants a and b are filled in automatically.
- 5Use the preset buttons (STP, SATP, Room Temp) to pre-populate typical conditions.
- 6For a before/after scenario (combined gas law), switch to "Combined Gas Law" mode and enter P₁, V₁, T₁ plus two of the three final-state values.
- 7Click Reset (or Escape) to clear all fields, or copy the result to the clipboard with the Copy button.
Example Calculation
Example 1, Solve for Pressure
A container holds 2.5 mol of nitrogen gas at 300 K in a 50 L vessel. What is the pressure?
Example 2, Van der Waals for CO₂
Same conditions but using Van der Waals constants for CO₂ (a = 3.640 L²·atm/mol², b = 0.04267 L/mol):
Understanding Ideal Gas Law | PV=nRT
What Is the Ideal Gas Law?
The Ideal Gas Law (PV = nRT) is one of the most fundamental equations in chemistry and physics. It models the behavior of an ideal gas, a theoretical gas where molecules have no volume and no interactions with each other. While no real gas is perfectly ideal, the equation provides excellent approximations under ordinary conditions (low pressure, high temperature) and forms the foundation for understanding more complex gas behaviors.
The equation unifies three historically separate empirical laws: Boyle's Law (1662), which showed pressure and volume are inversely proportional at constant temperature; Charles's Law (1787), showing volume and temperature are proportional at constant pressure; and Avogadro's hypothesis (1811), showing equal volumes of gases at the same conditions contain equal numbers of molecules.
When Does the Ideal Gas Law Break Down?
The ideal model fails when intermolecular forces or molecular size become significant, primarily at high pressures (molecules are forced close together) and low temperatures (kinetic energy is insufficient to overcome attractions). The Van der Waals equation corrects for both effects:
- ›The a term (pressure correction) accounts for attractive forces between molecules, it effectively increases the pressure needed to compress the gas.
- ›The b term (volume correction) accounts for the finite volume of gas molecules, it reduces the space actually available for molecular motion.
- ›Polar gases (NH₃, H₂O) deviate more strongly from ideal behavior than non-polar gases (N₂, noble gases).
- ›Near the critical point, even the Van der Waals equation loses accuracy; equations like Peng-Robinson or Redlich-Kwong are used instead.
Real-World Applications
- ›Stoichiometry: converting between gas volumes and moles in chemical reactions.
- ›Engineering: sizing pressure vessels, compressors, and gas storage tanks.
- ›Meteorology: modeling atmospheric pressure variations with altitude.
- ›Respiration physiology: understanding gas exchange in lungs (partial pressures, Dalton's Law).
- ›Scuba diving: computing tank capacity and partial pressures at depth (Boyle's Law applications).
- ›Combustion engines: analyzing compression ratios and exhaust gas volumes.
Key Derived Relationships
The Ideal Gas Law directly yields several important derived quantities:
- ›Molar volume at STP: V/n = RT/P = (8.314 × 273.15)/101325 ≈ 22.414 L/mol
- ›Gas density: ρ = PM/(RT), where M is molar mass in kg/mol
- ›Dalton's Law of partial pressures: P_total = P₁ + P₂ + ⋯ = (n₁ + n₂ + ⋯)RT/V
- ›Root-mean-square molecular speed: v_rms = √(3RT/M)
Frequently Asked Questions
What units should I use for temperature?
Temperature must be in Kelvin (absolute scale) for the Ideal Gas Law to work correctly. To convert: K = °C + 273.15. The calculator accepts °C and °F inputs and converts internally.
Using Celsius directly would give wrong answers, for example, 0°C is 273.15 K, not 0. At 0°C a gas still has significant thermal energy; only at absolute zero (0 K = −273.15°C) do molecules theoretically stop moving.
What is the value of R and why does it have different values?
R = 8.314 J/(mol·K) in SI units. The numerical value changes depending on which units of pressure and volume you use, the physical meaning is always the same.
- ›8.314 J/(mol·K), SI standard, use with Pa and m³
- ›0.08206 L·atm/(mol·K), most common in chemistry
- ›1.987 cal/(mol·K), thermochemistry contexts
- ›62.36 L·mmHg/(mol·K), pressure in mmHg
Pick the version that matches your unit system. This calculator handles conversions automatically regardless of which units you input.
What is STP and why does it matter?
STP (Standard Temperature and Pressure) is defined as 0°C (273.15 K) and 1 atm (101.325 kPa). At STP, one mole of any ideal gas occupies exactly 22.414 liters, a useful reference volume.
SATP (Standard Ambient Temperature and Pressure) uses 25°C and 100 kPa, giving a molar volume of 24.465 L/mol. STP is the older standard used in chemistry; SATP is preferred in engineering contexts. This calculator supports both as one-click presets.
How do I solve for moles when I know mass?
Divide the mass by the molar mass: n = mass / M. For example, 44 g of CO₂ (molar mass 44 g/mol) = 1 mol.
Once you have n, use PV = nRT normally. This two-step process (convert mass → moles → gas law) is the most common approach in stoichiometry problems involving gas volumes.
Molar masses: H₂ = 2 g/mol, N₂ = 28, O₂ = 32, CO₂ = 44, H₂O = 18, CH₄ = 16. For any gas, sum the atomic masses from the periodic table.
When should I use the Van der Waals equation instead of PV = nRT?
Use Van der Waals when the ideal approximation breaks down:
- ›Pressure exceeds ~10 atm, molecules are forced close together
- ›Temperature is close to the gas's boiling point, kinetic energy is insufficient to overcome attractions
- ›The gas is polar or has strong intermolecular forces (NH₃, H₂O, CO₂ at high pressures)
At standard lab conditions (1 atm, 25°C), the ideal gas law is accurate to within 0.1% for most gases and Van der Waals is unnecessary.
What is the Combined Gas Law and when do I use it?
The Combined Gas Law (P₁V₁/T₁ = P₂V₂/T₂) applies when the amount of gas (n) stays constant but conditions change. It combines Boyle's and Charles's Laws into one equation.
Common use cases:
- ›Gas cylinder heated from room temperature to 100°C, how does pressure change?
- ›Balloon rising in the atmosphere, how does volume change with dropping pressure and temperature?
- ›Gas compressed in a piston, find the new temperature or volume after compression
Why is pressure always absolute, not gauge?
Gauge pressure measures relative to atmospheric pressure, a tire at "32 psi" is 32 psi above atmospheric, so absolute pressure is ~46.7 psia.
The gas law requires absolute pressure because gas molecules respond to the total force per unit area, not just the force above atmosphere. Using gauge pressure would give wrong answers.
Conversion: P_absolute = P_gauge + P_atmospheric (14.696 psi, 101.325 kPa, or 1 atm at sea level). This calculator always uses absolute pressure internally.
What does this calculator do that a simple formula solver cannot?
Several things that would require multiple manual steps:
- ›Automatic unit conversions, enter psi, bar, atm, or kPa without manual conversion
- ›Van der Waals real-gas support with built-in constants for 15+ common gases
- ›STP and SATP presets for standard-condition problems
- ›Combined Gas Law mode for before/after scenarios
- ›Derived quantities: gas density (g/L), molar volume, and molecular speed
Each of those would be a separate multi-step calculation by hand. The calculator integrates them into a single workflow.