The ideal gas law (PV = nRT) is the fundamental equation of state for ideal gases, relating pressure, volume, amount of substance, and temperature through the universal gas constant R. Use this calculator to solve for any of the four variables when the other three are known — essential for chemistry, physics, and engineering problems involving gases at moderate conditions.
Inputs
Result
How to Use the Ideal Gas Law Calculator
The ideal gas law (PV = nRT) is one of the most important equations in chemistry and physics. This calculator solves for any of the four variables — pressure (P), volume (V), moles (n), or temperature (T) — when you provide the other three, with automatic unit conversion between common units.
Step 1: Select What to Solve For
Choose which variable you want to calculate from the "Solve for" dropdown. The corresponding input field will hide, and the other three input fields remain visible for you to enter values.
Step 2: Enter the Known Values
Fill in the three known quantities. For each measurement, select the appropriate unit from the dropdown. The calculator handles all unit conversions automatically — you can mix atm for pressure with °C for temperature without manually converting to Kelvin first.
Step 3: Click Calculate
The result appears in the right panel with a KaTeX-rendered equation showing the substituted values and a step-by-step breakdown. The appropriate gas constant R value is selected automatically based on your unit choices.
Worked Example: Molar Volume at STP
What volume does 1 mol of nitrogen gas (N₂) occupy at standard temperature and pressure (0°C, 1 atm)?
- Solve for: Volume (V)
- P = 1 atm, n = 1 mol, T = 0°C (= 273.15 K)
- V = nRT/P = (1)(0.08206)(273.15)/1 = 22.41 L
This is the familiar molar volume at STP — 22.4 liters per mole for any ideal gas.
Understanding the Gas Constant R
The gas constant R has different numerical values depending on the units used. When you select pressure in atm and volume in liters, R = 0.08206 L·atm/(mol·K). If you choose kPa and liters, R = 8.314 kPa·L/(mol·K). The calculator automatically adjusts R to match your unit selection, so results are always correct regardless of the units you choose.
Temperature Must Be in Kelvin
The ideal gas law requires absolute temperature in Kelvin (K). The calculator accepts °C or °F input and converts automatically. Remember: 0°C = 273.15 K, 25°C = 298.15 K (room temperature), 100°C = 373.15 K (boiling point of water). Never use °C or °F directly in the PV = nRT equation without converting first, as negative temperatures would give physically impossible negative volumes or pressures.
For a detailed walkthrough, see our guide: Ideal Gas Law Guide.
FAQ
What is the ideal gas law?
The ideal gas law (PV = nRT) relates pressure (P), volume (V), moles of gas (n), and temperature (T) through the universal gas constant R. It assumes gas molecules have no volume and no intermolecular forces — a good approximation at low pressures and high temperatures.
Is this calculator free?
Yes, completely free with no signup or account required. All calculations run in your browser.
Is my data private?
Yes. All calculations run locally in your browser. No data is sent to any server.
What is the value of R (gas constant)?
R = 0.08206 L·atm/(mol·K) in common chemistry units. In SI units, R = 8.314 J/(mol·K) = 8.314 Pa·m³/(mol·K). The calculator automatically selects the correct R value based on the units you choose for pressure and volume.
When does the ideal gas law fail?
The ideal gas law becomes inaccurate at high pressures (above ~10 atm), low temperatures (near liquefaction), or for gases with strong intermolecular forces like H2O or NH3. In those cases, the van der Waals equation or other real-gas models give better results.
What volume does 1 mol of ideal gas occupy at STP?
At STP (0°C, 1 atm), 1 mol of ideal gas occupies 22.4 liters. At SATP (25°C, 1 bar), the molar volume is 24.8 liters. These values come directly from PV = nRT.
How do I convert between temperature units?
The ideal gas law requires temperature in Kelvin (K). Convert: K = °C + 273.15. For Fahrenheit: K = (°F + 459.67) × 5/9. This calculator handles conversions automatically when you select °C or °F as input.