Ideal Gas Law Calculator
Solve PV = nRT for pressure, volume, moles, or temperature. Multiple units with automatic Kelvin conversion and step-by-step solutions.
This ideal gas law calculator solves PV = nRT for any of the four variables: pressure (P), volume (V), amount in moles (n), or temperature (T). Enter three known values and the tool computes the fourth, with automatic unit conversions and step-by-step workings. The gas constant R = 8.314 J/(mol K) is built in.
For educational purposes only. These calculators use simplified models and should not be used for engineering or safety-critical decisions.
About Ideal Gas Law Calculator
The Ideal Gas Law Formula
PV = nRT relates pressure, volume, temperature, and the number of moles of gas. It combines three earlier gas laws discovered between 1662 and 1808 by Boyle, Charles, and Avogadro.
| Solve For | Formula | Example |
|---|---|---|
| Pressure | P = nRT / V | 1 mol x 8.314 x 298 K / 0.0244 m³ = 101,543 Pa |
| Volume | V = nRT / P | 1 mol x 8.314 x 273.15 K / 101,325 Pa = 0.02241 m³ (22.41 L) |
| Moles | n = PV / RT | 101,325 x 0.01 / (8.314 x 300) = 0.406 mol |
| Temperature | T = PV / nR | 200,000 x 0.005 / (0.5 x 8.314) = 240.5 K |
Worked example: a balloon contains 0.05 mol of helium at 25 °C (298.15 K) and 1 atm (101,325 Pa). What is the volume? V = nRT/P = 0.05 x 8.314 x 298.15 / 101,325 = 0.001224 m³ = 1.224 litres. This matches the expected small size of a partially inflated helium balloon.
The Gas Constant R in Different Unit Systems
| Value of R | Units | When to Use |
|---|---|---|
| 8.314 | J/(mol K) or Pa m³/(mol K) | SI units (Pa and m³) |
| 8.314 | kPa L/(mol K) | Pressure in kPa, volume in litres |
| 0.08206 | atm L/(mol K) | Pressure in atm, volume in litres |
| 62.36 | mmHg L/(mol K) | Pressure in mmHg, volume in litres |
| 1.987 | cal/(mol K) | Thermochemistry |
The calculator handles unit matching automatically. You can enter pressure in any supported unit and volume in any supported unit, and it converts internally before applying the formula.
Standard Conditions Reference
| Standard | Temperature | Pressure | Molar Volume | Used In |
|---|---|---|---|---|
| STP (IUPAC, current) | 273.15 K (0 °C) | 100 kPa (1 bar) | 22.711 L/mol | Modern chemistry |
| STP (old definition) | 273.15 K (0 °C) | 101.325 kPa (1 atm) | 22.414 L/mol | Older textbooks |
| NTP | 293.15 K (20 °C) | 101.325 kPa (1 atm) | 24.04 L/mol | Engineering, NIST |
| SATP | 298.15 K (25 °C) | 100 kPa | 24.79 L/mol | Thermodynamics tables |
Be careful with STP - the IUPAC changed the definition in 1982 from 1 atm to 1 bar, which changes molar volume from 22.414 to 22.711 L/mol. Many textbooks still use the older value.
The Three Component Gas Laws
The ideal gas law combines three simpler relationships. Each holds when the other variables are constant.
| Law | Relationship | Constant | Formula | Discovered |
|---|---|---|---|---|
| Boyle's Law | P inversely proportional to V | T, n | P₁V₁ = P₂V₂ | Robert Boyle, 1662 |
| Charles's Law | V proportional to T | P, n | V₁/T₁ = V₂/T₂ | Jacques Charles, 1787 |
| Avogadro's Law | V proportional to n | P, T | V₁/n₁ = V₂/n₂ | Amedeo Avogadro, 1811 |
Example using Boyle's Law: a gas at 2 atm and 5 L is compressed to 2 L at constant temperature. New pressure = P₁V₁/V₂ = 2 x 5 / 2 = 5 atm. You can verify this with the ideal gas law calculator by keeping T and n the same and changing V.
When Does the Ideal Gas Law Break Down?
| Condition | Why It Fails | Better Model |
|---|---|---|
| High pressure (above ~10 atm) | Gas molecules are pushed close enough that their volume matters | Van der Waals equation |
| Low temperature (near boiling point) | Intermolecular forces become significant as molecules slow down | Van der Waals or Redlich-Kwong |
| Polar molecules (NH₃, H₂O, HCl) | Strong dipole-dipole forces between molecules | Van der Waals with molecule-specific constants |
| Very light gases (H₂, He) at low T | Quantum effects at very low temperatures | Quantum statistical mechanics |
For most everyday conditions - room temperature, atmospheric pressure, common gases like N₂, O₂, Ar, CO₂ - the ideal gas law is accurate to within 1-2%. It is the standard starting point for gas calculations in chemistry and engineering.
Common Applications
| Application | What You Calculate | Typical Values |
|---|---|---|
| Stoichiometry (gas volumes) | Volume of gas produced in a reaction | At STP, 1 mol = 22.4 L |
| Tyre pressure with temperature | Pressure change from cold to hot driving | 30 psi at 20 °C becomes ~33 psi at 60 °C |
| Altitude and pressure | Air pressure decreases with altitude | ~84 kPa at 1,500 m vs 101.3 kPa at sea level |
| Scuba tank fill | Moles of air in a pressurised cylinder | 12 L tank at 200 bar holds ~100 mol |
| Weather balloon sizing | Volume at altitude as pressure drops | 1 m³ at ground expands to ~100 m³ at 30 km |
For liquid and hydrostatic pressure problems, the pressure calculator handles P = F/A and P = rho x g x h. For material density values used in gas density calculations (d = PM/RT), the density calculator covers solids and liquids. All calculations run entirely in your browser with no data sent anywhere.
How Accurate Is the Ideal Gas Law in Practice?
For most everyday gases near room temperature and atmospheric pressure, PV = nRT predicts behaviour within about 1% of experimental values. The deviation is quantified by the compressibility factor Z = PV/(nRT), which equals exactly 1 for an ideal gas. Real gases deviate from Z = 1 in predictable ways as conditions change.
| Gas | Z at 1 atm, 25 °C | Z at 100 atm, 25 °C | Notes |
|---|---|---|---|
| Helium | 1.0005 | 1.05 | Nearly ideal across wide range |
| Nitrogen | 0.9998 | 1.01 | Close to ideal under STP |
| Oxygen | 0.9994 | 0.95 | Slight attraction at moderate P |
| Carbon dioxide | 0.9949 | 0.25 | Strong deviation near critical point (31 °C, 73.8 atm) |
| Water vapour | 0.9832 | Condenses | Polar molecules deviate early |
When Z drops below 1, attractive forces between molecules are pulling them closer than the ideal model predicts. When Z rises above 1, the molecules' own volume starts to dominate and gas becomes harder to compress. The Van der Waals equation adds two correction constants (a for attraction, b for molecular volume) per gas and typically brings Z within 0.5% of measured values up to 50 atm.
Kinetic Theory Behind PV = nRT
The ideal gas law emerges directly from the kinetic theory of gases, first formalised by James Clerk Maxwell and Ludwig Boltzmann in the 1860s. Starting from a cloud of point particles in random motion that collide only elastically, you can derive PV = (1/3)Nm<v²>, where N is the number of molecules, m is molecular mass, and <v²> is the mean-square velocity. Linking kinetic energy to temperature via (1/2)m<v²> = (3/2)k_B T gives PV = Nk_B T, which becomes PV = nRT when you group Avogadro's number into the gas constant (R = N_A × k_B).
This derivation means R is not an arbitrary empirical constant - it connects the macroscopic properties of a gas (pressure, volume, temperature) to the microscopic kinetic energy of its molecules. The 2019 SI redefinition made this link exact by fixing the Boltzmann constant k_B = 1.380649 × 10⁻²³ J/K by definition, which in turn fixes R = 8.314462618 J/(mol K) exactly per the CODATA 2022 adjustment published by NIST.
Temperature Must Always Be in Kelvin
Using Celsius or Fahrenheit in PV = nRT produces wildly wrong answers because these scales have arbitrary zero points. A gas at 20 °C has a pressure determined by its absolute temperature of 293.15 K, not by the number 20. Double the Celsius temperature to 40 °C and the pressure increases only by the factor 313.15/293.15 = 1.068, not by 2. The calculator converts Celsius and Fahrenheit inputs to Kelvin internally before applying the formula, but if you are working through a problem by hand, the conversion is the single most common source of errors in introductory chemistry.
Worked example - tyre pressure on a hot day: a car tyre reads 32 psi (2.207 bar gauge, 3.22 bar absolute) at 15 °C (288.15 K). After motorway driving the tyre temperature reaches 55 °C (328.15 K). Volume and moles are essentially constant, so P₂ = P₁ × T₂/T₁ = 3.22 × 328.15/288.15 = 3.667 bar absolute, which is 2.653 bar gauge or 38.5 psi. This is why tyre manufacturers specify cold pressures - the same tyre reads 6-7 psi higher after a long drive.
Common Mistakes That Throw Off Gas Law Calculations
- Using gauge pressure instead of absolute. Tyre pressures, bike pumps, and scuba gauges all read pressure above atmospheric. PV = nRT needs absolute pressure, so add 1 atm (14.7 psi, 1.013 bar) to any gauge reading before using it.
- Forgetting to convert litres to m³. Mixing units produces answers off by factors of 1,000. If you use Pa for pressure and L for volume, you must remember 1 L = 0.001 m³ or switch to kPa × L, which pairs cleanly with R = 8.314 kPa L/(mol K).
- Treating water vapour as ideal at low temperature. Below the dew point, water condenses and the gas law fails outright. For humid air at room temperature, the dry-air and water-vapour partial pressures need to be handled separately.
- Using the 1 atm STP value for modern problems. IUPAC redefined STP to 100 kPa in 1982. Molar volume dropped from 22.414 L/mol (old) to 22.711 L/mol (current). Older textbooks and engineering references still quote 22.4, so check which convention your problem uses.
- Ignoring the compressibility factor near the critical point. CO₂ at room temperature and 70 atm behaves nothing like an ideal gas - Z drops below 0.3 as the gas approaches its liquid phase. For pressurised industrial systems, the Redlich-Kwong or Peng-Robinson equations give much better predictions.
How the Gas Laws Fit Together Historically
The path from Boyle to Avogadro took almost 150 years and involved multiple dead ends. Robert Boyle published his pressure-volume relationship in 1662 using a J-shaped glass tube partially filled with mercury, compressing trapped air at constant temperature. Jacques Charles discovered the temperature-volume relationship around 1787 but never published it - the law bears his name because Joseph Louis Gay-Lussac cited his work in 1802. Amedeo Avogadro proposed in 1811 that equal volumes of gases at the same temperature and pressure contain equal numbers of particles, but the idea was ignored for nearly 50 years until Stanislao Cannizzaro championed it at the 1860 Karlsruhe Conference.
The combined ideal gas law in the form PV = nRT was formalised by French engineer Benoît Paul Émile Clapeyron in 1834. His contribution was recognising that the three earlier laws could be unified into a single equation of state, and identifying the gas constant as a universal quantity rather than one that varied between gases. For more on gas properties, see the density calculator, which handles gas density via d = PM/RT where M is molar mass in kg/mol.
Sources
- NIST - CODATA Value: Molar Gas Constant R
- Wikipedia - Ideal Gas Law (PV = nRT, derivation and history)
- IUPAC Gold Book - Standard Conditions for Gases (STP)
- Wikipedia - Van der Waals Equation and Compressibility Factor
- NIST - Fundamental Physical Constants (CODATA 2022)
- Encyclopaedia Britannica - Boyle's, Charles's, and Avogadro's Laws
Frequently Asked Questions
What is the ideal gas law?
The ideal gas law (PV = nRT) relates pressure (P), volume (V), amount in moles (n), the gas constant (R = 8.314 J/mol K), and temperature (T in Kelvin). It describes how these properties of a gas are connected.
What is the gas constant R?
The universal gas constant R equals 8.314462 J/(mol K). It can also be expressed as 0.08206 L atm/(mol K) when using litres and atmospheres. This calculator uses the SI value and handles unit conversions internally.
Why must temperature be in Kelvin?
The ideal gas law requires absolute temperature (Kelvin) because gas properties are proportional to absolute temperature. At 0 K (-273.15 C), an ideal gas would have zero volume. The calculator automatically converts Celsius and Fahrenheit inputs to Kelvin.
When does the ideal gas law break down?
The ideal gas law assumes gas particles have no volume and no intermolecular forces. It works well at low pressures and high temperatures but breaks down near condensation points, at very high pressures, or for polar molecules. Real gas equations like van der Waals provide corrections.
What is STP in chemistry?
Standard Temperature and Pressure (STP) is 273.15 K (0 C) and 100 kPa. At STP, one mole of an ideal gas occupies 22.711 litres. The older definition used 101.325 kPa (1 atm), giving 22.414 litres per mole.
Related Tools
Link to this tool
Copy this HTML to link to this tool from your website or blog.
<a href="https://toolboxkit.io/tools/ideal-gas-law-calculator/" title="Ideal Gas Law Calculator - Free Online Tool">Try Ideal Gas Law Calculator on ToolboxKit.io</a>