Ideal Gas Law Calculator
Solve the equation of state P · V = n · R · T for any of its four unknowns — pressure, volume, moles, or temperature — with step-by-step math, a live piston-cylinder schematic, and companion kinetic-theory metrics.
It combines three empirical gas laws
The ideal gas law is the unification of Boyle's law (P ∝ 1/V at constant T), Charles's law (V ∝ T at constant P), and Avogadro's law (V ∝ n at constant T, P). Combining them gives PV ∝ nT, and the constant of proportionality is R — the universal gas constant. This is why the equation applies to any gas, at any conditions, as long as the density is low enough for interactions between molecules to be negligible.
R is the bridge between macroscopic and microscopic
The gas constant R = 8.314 J/(mol·K) is really Avogadro's number times Boltzmann's constant: R = NA · kB = 6.022 × 10²³ × 1.381 × 10⁻²³. This is why R appears in the ideal gas law but kB appears in single-particle expressions like the kinetic energy per molecule: they describe the same physics at two different scales. The ideal gas law is the statistical-mechanics result that the mean kinetic energy of a gas is (3/2)kBT per molecule — everything follows from that one fact.
It assumes point particles with no interactions
The ideal gas law treats molecules as point masses that collide elastically but otherwise don't interact. Real gases deviate from ideal behaviour at high pressure and low temperature, where the finite size of molecules matters (excluded volume) and attractive forces pull molecules together (van der Waals forces). Van der Waals' equation (P + a·n²/V²)(V − nb) = nRT corrects for both effects, and this calculator's output should be understood as the ideal-gas limit that real gases approach at low density.
Always use absolute temperature
The T in the ideal gas law is absolute temperature in kelvin. Using degrees Celsius instead of kelvin is one of the most common errors in gas-law calculations — and it can produce answers that are wrong by a factor of 2 or more. A gas at 25 °C and one at 25 K have radically different behaviours; only the kelvin value belongs in the equation. The conversion is T(K) = T(°C) + 273.15, and the calculator handles it automatically.
How to Use This Calculator
The ideal gas law links four quantities: pressure P, volume V, moles n, and absolute temperature T (with R as the universal constant). Pick which one you want the tool to solve, then fill in the other three.
1. Choose what to solve for
Pick P (pressure from V, n, T), V (volume from P, n, T), n (moles from P, V, T), or T (temperature from P, V, n). The tool rearranges the formula automatically.
2. Use realistic presets
Presets span the practical range: pressure from 10 kPa (upper atmosphere) to 20 MPa (high-pressure storage); volume from 0.5 L (a breath) to 50,000 L (industrial); moles from 0.01 to 1,000; temperature from 77 K (LN₂) to 1,000 K (combustion).
3. Watch your units
This calculator works in kPa, L, mol, and K with R = 8.314 kPa·L/(mol·K) — note that the numerical value of R differs from the SI form 8.314 J/(mol·K), even though both equal the same physical constant, because the volume unit is litres rather than cubic metres.
4. Read the result and verdict
The result card shows the solved value plus the equivalent units (atm, psi, bar for pressure; m³ and cm³ for volume; °C and °F for temperature). A colour-coded verdict classifies the pressure from vacuum through atmospheric, low-pressure, moderate, high, and ultra-high-pressure ranges.
5. Check the schematic and charts
The schematic shows a piston-cylinder with the pressure pushing down on the piston, the volume of gas below, and the temperature indicator on the side — all updating live. The chart plots P against V (a hyperbola, Boyle's law) for three different temperatures.
6. Switch to Advanced for depth
Advanced mode adds a P-vs-T chart (Gay-Lussac's law), a 1% sensitivity check on each input, and companion kinetic-theory metrics including number density, molar volume, mean molecular speed, kinetic energy per molecule, and the mass density for a typical gas like air.
What This Tool Offers
Built around the classic equation of state P · V = n · R · T, the foundation of thermodynamics and the connection between the macroscopic and microscopic worlds.
Four-way solving
Solve for pressure, volume, moles, or temperature. The calculator rearranges the formula for whichever variable you choose.
Live piston-cylinder schematic
A gas container with the pressure arrow, the volume dimension, and the temperature indicator — all drawn and labelled with current values. The gas fill and piston move as V changes.
Pressure-scale verdict
Every result is classified from vacuum through atmospheric, low, moderate, high, up to ultra-high-pressure ranges, with a coloured badge.
Multi-unit hints
Each field shows its value in related units — atm, bar, psi for pressure; m³ and cm³ for volume; °C and °F for temperature.
Dual comparison charts
P vs V (Boyle's law hyperbola) for three temperatures, plus an advanced P vs T chart (Gay-Lussac's law) for three volumes.
Reference tables
Values of R in various units, standard conditions (STP, SATP, NTP), specific gas constants for common gases, and companion formulas for density, molar volume, and kinetic theory.
Reference Tables & Conversions
A quick pressure estimator, unit converter, and reference tables for the gas constant, standard conditions, and common gases.
Quick pressure estimator
Values of the Universal Gas Constant R
The numerical value of R depends on the units used for pressure, volume, and temperature. All the values below are exactly equivalent.
| Units | Value of R | Common use |
|---|---|---|
| J/(mol·K) (SI) | 8.314462618 | Thermodynamics, energy calculations |
| kPa·L/(mol·K) | 8.314462618 | This calculator — conveniently equal to SI form |
| Pa·m³/(mol·K) | 8.314462618 | Base SI units |
| atm·L/(mol·K) | 0.082057 | Classical chemistry — standard reference |
| bar·L/(mol·K) | 0.083145 | Industrial gas processes |
| mmHg·L/(mol·K) | 62.364 | Medical and vacuum applications |
| cal/(mol·K) | 1.98720 | Classical thermodynamics |
| L·torr/(mol·K) | 62.364 | Torr = mmHg |
| ft·lbf/(lbmol·°R) | 10.7316 | US customary engineering |
Standard Reference Conditions
The ideal gas law's predictions depend on which reference temperature and pressure are chosen.
| Condition | T (K) | P (kPa) | Molar volume (L/mol) |
|---|---|---|---|
| STP (IUPAC 1982+) | 273.15 | 100.000 | 22.711 |
| STP (traditional) | 273.15 | 101.325 | 22.414 |
| SATP (IUPAC) | 298.15 | 100.000 | 24.789 |
| NTP (Normal) | 293.15 | 101.325 | 24.055 |
| Standard lab (25 °C, 1 atm) | 298.15 | 101.325 | 24.465 |
| ISO 13443 natural gas | 288.15 | 101.325 | 23.645 |
Specific Gas Constants of Common Gases
The specific gas constant Rspec = R / M is used in the mass-based form P = ρ · Rspec · T. Values in J/(kg·K).
| Gas | Formula | Molar mass (g/mol) | R_spec (J/(kg·K)) | Density at 25 °C, 1 atm (kg/m³) |
|---|---|---|---|---|
| Hydrogen | H₂ | 2.016 | 4,124 | 0.0824 |
| Helium | He | 4.003 | 2,077 | 0.1636 |
| Nitrogen | N₂ | 28.01 | 296.8 | 1.145 |
| Air (dry) | — | 28.97 | 287.0 | 1.184 |
| Oxygen | O₂ | 32.00 | 259.8 | 1.308 |
| Argon | Ar | 39.95 | 208.1 | 1.633 |
| Carbon dioxide | CO₂ | 44.01 | 188.9 | 1.799 |
| Methane | CH₄ | 16.04 | 518.3 | 0.656 |
| Ammonia | NH₃ | 17.03 | 488.2 | 0.696 |
| Water vapour | H₂O | 18.02 | 461.5 | 0.737 |
| Propane | C₃H₈ | 44.10 | 188.6 | 1.803 |
| Sulphur hexafluoride | SF₆ | 146.06 | 56.92 | 5.971 |
Unit Conversions for P, V and T
| Quantity | Unit | Equivalent in SI / common form |
|---|---|---|
| Pressure | 1 Pa | 1 N/m² = 1 × 10⁻³ kPa |
| Pressure | 1 kPa | 1,000 Pa = 0.01 bar = 0.00987 atm |
| Pressure | 1 bar | 100 kPa = 0.987 atm = 14.504 psi |
| Pressure | 1 atm | 101.325 kPa = 1.01325 bar = 14.696 psi = 760 torr |
| Pressure | 1 psi | 6.895 kPa = 0.06895 bar |
| Pressure | 1 torr (mmHg) | 0.13332 kPa |
| Volume | 1 L | 1 dm³ = 0.001 m³ = 1,000 cm³ = 1,000 mL |
| Volume | 1 m³ | 1,000 L = 1 × 10⁶ cm³ |
| Volume | 1 ft³ | 28.317 L = 0.028317 m³ |
| Volume | 1 US gal | 3.7854 L |
| Volume | 1 imp gal | 4.5461 L |
| Temperature | T(K) | T(°C) + 273.15 |
| Temperature | T(°C) | T(K) − 273.15 |
| Temperature | T(°F) | T(K) × 9/5 − 459.67 |
What Does P · V = n · R · T Measure?
The ideal gas law is the equation of state for a dilute gas. It says that the product of pressure and volume is proportional to the amount of gas (in moles) times the absolute temperature. The constant of proportionality R = 8.314 J/(mol·K) is the same for every gas — it is a universal constant of nature, as fundamental as the speed of light or the gravitational constant. The law unifies three centuries of empirical gas research (Boyle, Charles, Avogadro, Gay-Lussac) into a single compact equation, and it is the starting point for almost every thermodynamic calculation.
The Ideal Gas Law Formula
The defining relationship is:
Rearranged to solve for the other three variables:
V = n · R · T ÷ P
n = P · V ÷ ( R · T )
T = P · V ÷ ( n · R )
Because the relation is linear in P, V, n, and T — holding R fixed — every variable appears to the first power only. This makes the equation algebraically the simplest of all thermodynamic relations, even though it captures an enormous range of physical behaviour.
Ideal Gas Law Variables
| Symbol | Meaning | Common units |
|---|---|---|
| P | Absolute pressure | kPa, bar, atm, psi, Pa |
| V | Volume | L, m³, cm³, ft³ |
| n | Amount of substance (moles) | mol, kmol, mmol |
| R | Universal gas constant | 8.314 J/(mol·K) = 8.314 kPa·L/(mol·K) |
| T | Absolute temperature | K (kelvin) |
| N | Number of molecules = n · NA | dimensionless (count) |
| ρ | Mass density = nM / V = PM / (RT) | kg/m³ |
| M | Molar mass | g/mol or kg/mol |
The Three Empirical Laws Behind It
The ideal gas law is not a single empirical discovery — it is the fusion of three separate experimental results, each valid at different fixed conditions. Boyle's law (1662) says that at constant temperature, P × V is constant — compress a gas to half its volume and the pressure doubles. Charles's law (1787) says that at constant pressure, V ∝ T — heat a gas from 300 K to 600 K and it expands to twice the volume. Avogadro's law (1811) says that at constant temperature and pressure, V ∝ n — double the molecules and the volume doubles. Multiply these three proportionalities together and you get PV ∝ nT, which becomes PV = nRT once the constant of proportionality R is inserted.
How Each Variable Affects the Result
Pressure P is directly proportional to n and T, and inversely proportional to V. Doubling the moles doubles the pressure (at fixed V and T); doubling the temperature doubles the pressure (at fixed V and n); halving the volume doubles the pressure (at fixed n and T). This is why a sealed container of gas at constant volume and rising temperature becomes dangerous — the pressure rises without limit.
Volume V follows the same pattern from the other direction. If you need a specific pressure from a given number of moles at a given temperature, the required volume is nRT/P — and doubling the moles or halving the temperature requires doubling the volume to keep the pressure the same.
Amount n scales directly with P·V / T. It is the chemical quantity that underlies stoichiometry, and the ideal gas law is the bridge between the measurable (P, V, T) and the countable (n, N).
Temperature T must be absolute — kelvin, not Celsius or Fahrenheit. A gas at 0 °C has a temperature of 273.15 K and is not at "zero temperature"; the ideal gas law operates from absolute zero upwards, and all gas behaviour vanishes as T → 0.
Worked Examples
P = nRT / V = 1 × 8.314 × 298.15 / 24.47
P = 101.3 kPa = 1.000 atm
V = nRT / P = 2 × 8.314 × 300 / 200
V = 24.94 L
n = PV / (RT) = 101.325 × 1 / (8.314 × 273.15)
n = 0.04462 mol (which is exactly 1 / 22.414, the reciprocal of the molar volume at STP)
T = PV / (nR) = 500 × 10 / (2 × 8.314)
T = 300.7 K = 27.6 °C
V₂ = V₁ · T₂ / T₁ = 1 × 373.15 / 298.15
V₂ = 1.252 L (a 25% increase for a 75 °C rise)
Frequently Asked Questions
It is the equation of state for a dilute gas — a mathematical relationship that connects four macroscopic properties (pressure, volume, amount, temperature) at any equilibrium state. It states that the product of pressure and volume equals the number of moles times the universal gas constant times the absolute temperature. The equation is the single most-used relation in chemistry and thermodynamics, and it underlies everything from weather prediction to engine design to the behaviour of the atmosphere on other planets.
Because the ideal gas law is linear in T only when T is measured from absolute zero. The relationship V ∝ T that Charles discovered requires T to be an absolute scale — 0 K means the gas has zero thermal energy, and every doubling of T doubles the volume at constant pressure. Using Celsius or Fahrenheit in the formula produces numerically wrong answers, sometimes by a factor of 2 or more. The conversion is T(K) = T(°C) + 273.15. Always convert to kelvin before plugging into the equation.
R is the universal gas constant — the same physical constant in every unit system. Its value is 8.314462618 J/(mol·K) in SI, which happens to also equal 8.314462618 kPa·L/(mol·K) because the conversion factors for J→kPa·L happen to be exactly 1 (1 J = 1 Pa·m³ = 1 kPa·L). But in atm·L/(mol·K) the value is 0.08206, and in cal/(mol·K) it is 1.987. These different numbers all represent the same physical constant — they are just expressed in different units, in exactly the same way that the speed of light is 299,792,458 m/s or 186,282 miles/s.
The ideal gas law assumes that molecules are point masses with no interactions. Real gases deviate from ideal behaviour in two regimes. First, at high pressure the finite volume of molecules becomes significant, so the available volume for motion is less than the geometric volume — this makes the measured pressure higher than the ideal prediction. Second, at low temperature the attractive forces between molecules become significant, so molecules cluster and the pressure is lower than the ideal prediction. Van der Waals' equation and other more sophisticated equations of state (Redlich-Kwong, Peng-Robinson, etc.) account for these effects. For most gases at atmospheric pressure and room temperature, the ideal gas law is accurate to better than 1%.
An ideal gas is a theoretical model in which molecules have zero volume and no attractive forces between them; the only interactions are perfectly elastic collisions. A real gas has molecules of finite size and exhibits both attractive and repulsive interactions. Real gases approach ideal behaviour at low pressure (large volume per molecule) and high temperature (kinetic energy dominates over intermolecular potential energy). Helium and hydrogen are the closest to ideal; carbon dioxide and water vapour deviate the most because of their larger molecules and stronger intermolecular forces.
The molar volume is the volume occupied by one mole of an ideal gas at a given temperature and pressure. At the traditional STP (273.15 K, 101.325 kPa), it is 22.414 L/mol. At the newer IUPAC STP (273.15 K, 100.000 kPa), it is 22.711 L/mol. At SATP (298.15 K, 100.000 kPa), it is 24.789 L/mol. At "standard lab" (298.15 K, 101.325 kPa), it is 24.465 L/mol. This calculator works with kPa and L, so the standard lab molar volume of 24.47 L is what you get when you enter n = 1 mol, T = 298.15 K, P = 101.325 kPa.
Almost everywhere: sizing compressed-gas storage vessels (hydrogen, natural gas, medical oxygen), designing internal combustion engines (intake and exhaust gas volumes), predicting weather (atmospheric density and pressure gradients), sizing HVAC ducts (air density varies with temperature), calculating gas flow through pipelines, designing chemical reactors (gas-phase reactions need accurate P-V-T relations), modelling the atmosphere of other planets, and estimating the lift of hot-air balloons. In every case, the ideal gas law is the first-order model, and more sophisticated equations are applied only when accuracy demands it.
Variables
| Symbol | Quantity | Unit |
|---|---|---|
| P | Pressure | Pa |
| V | Volume | m³ |
| n | Moles | mol |
| R | Gas constant | J/(mol·K) |
| T | Temperature | K |
What it means
The ideal gas law is an equation of state that describes the behavior of an ideal gas under various conditions. It states that the product of pressure (P) and volume (V) is proportional to the number of moles (n) and absolute temperature (T): PV = nRT, with R = 8.314 J/(mol·K). This law assumes that gas particles have negligible volume and no intermolecular forces. It works well for real gases at low pressures and high temperatures. The ideal gas law combines Boyle's law (P ∝ 1/V at constant T), Charles's law (V ∝ T at constant P), and Avogadro's law (V ∝ n at constant P and T). It is used in many fields, including chemical engineering, meteorology, and aerodynamics. It allows calculation of unknown properties when three are known. The law is also the starting point for more complex equations of state (e.g., van der Waals). Applications include sizing gas cylinders, calculating buoyancy, and designing internal combustion engines.
Worked example
| # | P (Pa) | V (m³) | n (mol) | R (J/mol·K) | T (K) |
|---|---|---|---|---|---|
| 1 | 101325 | 0.0245 | 1.00 | 8.314 | 298.15 |
| 2 | 202650 | 0.0245 | 2.00 | 8.314 | 298.15 |
| 3 | 101325 | 0.0490 | 2.00 | 8.314 | 298.15 |
| 4 | 101325 | 0.0245 | 1.00 | 8.314 | 596.30 |
| 5 | 150000 | 0.0300 | 1.50 | 8.314 | 360.87 |
| 6 | 200000 | 0.0200 | 2.00 | 8.314 | 240.52 |
| 7 | 80000 | 0.0400 | 1.50 | 8.314 | 256.64 |
| 8 | 120000 | 0.0250 | 1.20 | 8.314 | 300.65 |
| 9 | 250000 | 0.0100 | 2.00 | 8.314 | 150.33 |
| 10 | 101325 | 0.0735 | 3.00 | 8.314 | 298.15 |
| 11 | 90000 | 0.0450 | 2.00 | 8.314 | 243.63 |
| 12 | 180000 | 0.0280 | 2.50 | 8.314 | 242.76 |
| 13 | 110000 | 0.0330 | 1.80 | 8.314 | 242.88 |
| 14 | 130000 | 0.0220 | 1.40 | 8.314 | 244.40 |
| 15 | 160000 | 0.0260 | 2.20 | 8.314 | 228.63 |
Common mistakes
- Wrong R value: Use R = 8.314 J/(mol·K) for SI; with other units (e.g., L·atm) use R = 0.0821.
- Temperature in Kelvin: Always use absolute temperature – never °C or °F.
- Volume units: Use m³ with Pa, or litres with the appropriate R.
- Ideal gas assumption: Valid only at low pressure and high temperature; not near condensation.
- Number of moles: n = mass / molar mass; do not use total mass directly.
Applications
The ideal gas law PV = nRT is a fundamental equation that relates pressure, volume, temperature, and amount of gas for ideal gases. It is indispensable in chemistry, physics, and engineering for predicting the behaviour of gases under various conditions. In industrial processes, it is used to size gas storage tanks, design pneumatic systems, and control chemical reactors. In meteorology, it helps model atmospheric pressure and weather patterns. The law also underpins the operation of internal combustion engines, gas turbines, and refrigeration cycles, where gas properties change during compression and expansion. It is also applied in the calibration of gas flow meters and in the study of thermodynamic cycles. Even though real gases deviate, the ideal gas law provides a close approximation for many engineering calculations.
- Design of pressure vessels and gas pipelines
- Pneumatic actuators and control systems
- Gas turbine and jet engine performance modelling
- Air conditioning and refrigeration cycle analysis
- Meteorological forecasting and atmospheric studies
Related calculators · Thermodynamics
Recently updated formulas
Suggest an improvement
Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.