Gas Law Calculator Online — Ideal Gas Law Explained With Examples
A practical guide to the ideal gas law (PV=nRT), when it applies, and how to use a free online calculator to solve gas law problems instantly.
The ideal gas law is one of the most versatile equations in chemistry and chemical engineering — a single relationship connecting pressure, volume, temperature, and moles of any gas under conditions where molecular interactions are negligible. If you're in a lab, a plant control room, or a classroom, you'll reach for it constantly.
This guide covers the equation, when it applies, how to use an online calculator to solve it instantly, and where the ideal gas assumption breaks down.
The Ideal Gas Law
PV = nRT
Where:
| Symbol | Variable | SI Unit | Common Alternatives |
|---|---|---|---|
| P | Pressure | Pa (Pascal) | atm, bar, kPa, psi |
| V | Volume | m³ | L, mL |
| n | Amount of substance | mol | — |
| R | Universal gas constant | 8.314 J/(mol·K) | 0.08206 L·atm/(mol·K) |
| T | Temperature | K (Kelvin) | °C (convert: K = °C + 273.15) |
The equation is deceptively simple. Given any three of the four variables (P, V, n, T), you can solve for the fourth. In practice, this means you can calculate:
- What happens to pressure when you heat a sealed container
- How much volume a gas occupies at a different pressure or temperature
- How many moles of gas are present given measured conditions
- What temperature is required to achieve a target pressure or volume
How to Use the Gas Law Calculator
Open the Gas Law Calculator at toolzworld →
Enter any three of the four variables (P, V, n, T) and select the unit for each. The calculator solves for the missing variable and returns the result in your chosen unit.
Critical: always enter temperature in Kelvin. The ideal gas law is only valid with absolute temperature. Room temperature (25°C) is 298.15 K. Entering degrees Celsius directly will produce wrong answers. The calculator handles this conversion for you if you select °C as the input unit.
The Four Classic Gas Law Problems
The ideal gas law encompasses four historically named sub-laws, each fixing two of the four variables:
Boyle's Law (Constant T, n)
Pressure and volume are inversely proportional at constant temperature.
P₁V₁ = P₂V₂
Example: A gas occupies 4 L at 2 atm. What volume does it occupy at 8 atm (same temperature)?
V₂ = P₁V₁ / P₂ = (2 × 4) / 8 = 1 L
Applications: Syringe mechanics, tire inflation, compressed gas storage.
Charles's Law (Constant P, n)
Volume and temperature are directly proportional at constant pressure.
V₁/T₁ = V₂/T₂
Example: A gas occupies 10 L at 300 K. What volume does it occupy at 600 K at the same pressure?
V₂ = V₁ × (T₂/T₁) = 10 × (600/300) = 20 L
Applications: Hot air balloon design, explaining why bread rises more in a warm oven, gas thermometry.
Gay-Lussac's Law (Constant V, n)
Pressure and temperature are directly proportional at constant volume.
P₁/T₁ = P₂/T₂
Example: A sealed tank reads 150 psi at 20°C (293 K). What pressure will it read at 80°C (353 K)?
P₂ = P₁ × (T₂/T₁) = 150 × (353/293) ≈ 181 psi
Applications: Autoclave operation, aerosol can warnings about heat, pressure vessel safety.
Avogadro's Law (Constant T, P)
Equal volumes of gases at the same temperature and pressure contain equal numbers of moles.
V₁/n₁ = V₂/n₂
Application: At standard temperature and pressure (STP: 0°C, 1 atm), one mole of any ideal gas occupies 22.4 L. This is one of the most-used constants in chemistry.
Worked Example: Full PV = nRT Calculation
Problem: A balloon is filled with 0.5 mol of helium at 25°C and 1.2 atm. What is the volume of the balloon?
Given:
- n = 0.5 mol
- T = 25°C = 298.15 K
- P = 1.2 atm
- R = 0.08206 L·atm/(mol·K)
Solve for V:
V = nRT / P = (0.5 × 0.08206 × 298.15) / 1.2 = 12.23 / 1.2 ≈ 10.2 L
Plug these values into the calculator to verify — and use it for your own problems without needing to track unit conversions.
When the Ideal Gas Law Breaks Down
The ideal gas law assumes:
- Gas molecules have zero volume
- There are no intermolecular attractive or repulsive forces
- Collisions between molecules are perfectly elastic
These assumptions hold reasonably well at low pressures and high temperatures — conditions where molecules are far apart and moving fast. The model becomes inaccurate when:
Pressure is very high (above ~10 atm): molecules are compressed close enough together that their actual volume and intermolecular forces become significant.
Temperature is close to the boiling point: near condensation, van der Waals attractions between molecules become strong enough to affect behavior measurably.
The gas is polar or has strong intermolecular forces: CO₂, NH₃, H₂O vapor, and SO₂ deviate from ideal behavior more than noble gases or N₂/O₂ at the same conditions.
For high-pressure or near-condensation conditions, use the van der Waals equation or more sophisticated equations of state (Peng-Robinson, Soave-Redlich-Kwong) which are standard in chemical engineering process simulation.
Unit Conversions Quick Reference
The ideal gas law requires consistent units. Common conversions:
| Quantity | Conversion |
|---|---|
| Temperature | K = °C + 273.15 |
| Pressure | 1 atm = 101,325 Pa = 1.01325 bar = 14.696 psi |
| Volume | 1 m³ = 1,000 L = 1,000,000 mL |
| R (SI) | 8.314 J/(mol·K) = 8.314 Pa·m³/(mol·K) |
| R (practical) | 0.08206 L·atm/(mol·K) |
Frequently Asked Questions
Q: Can I use the ideal gas law for mixtures of gases? A: Yes — for mixtures, use the total number of moles (n_total) for total pressure, or use Dalton's Law of Partial Pressures: each component gas exerts pressure independently, and the total pressure is the sum of all partial pressures.
Q: Does the ideal gas law apply to steam? A: Water vapor deviates significantly from ideal behavior, especially near condensation conditions. For accurate steam calculations, use steam tables or the IAPWS-IF97 formulation. The ideal gas law gives rough estimates only for superheated steam at low pressure.
Q: What is STP and how does it differ from NTP? A: STP (Standard Temperature and Pressure) is 0°C (273.15 K) and 1 atm — molar volume of ideal gas: 22.4 L/mol. NTP (Normal Temperature and Pressure) is 20°C (293.15 K) and 1 atm — molar volume: 24.04 L/mol. Always specify which standard you're using when reporting gas volumes.
Q: How do I handle a problem where both temperature and pressure change? A: Use the combined gas law: P₁V₁/T₁ = P₂V₂/T₂ (assuming constant n). The online calculator handles this directly — enter your initial and final conditions.
The Bottom Line
The ideal gas law is the right starting point for almost any gas-phase calculation. It's accurate enough for most engineering and laboratory conditions, and the online calculator eliminates the arithmetic entirely.
Use the Gas Law Calculator at toolzworld →
Engineering calculators on toolzworld use equations verified against standard thermodynamics references. All calculations run locally in your browser.