Formula & Calculator

Ideal Gas Law

This law ties together the pressure, volume, temperature, and amount of a gas. It says pressure times volume equals the number of moles times a constant times temperature. For example, if you heat a sealed can, the pressure inside rises because the volume cannot change. If you let the gas expand while keeping temperature constant, pressure drops. It is used in everything from designing engines and air conditioning to predicting weather and scuba diving safety.

Mechanical Thermodynamics Gas Laws
VORZEP · THERMODYNAMICS & GAS LAWS TOOLS

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.

P · V = n · R · T
Visual relationship — P · V = n · R · T
P pressure 101.3 kPa
·
V volume 24.47 L
=
n moles 1.000 mol
·
R gas constant 8.314
·
T temperature 298.15 K
HYPERBOLIC RESPONSE — P vs V at constant T
Solve for
Pressure (P) Absolute pressure of the gas. Typical: 101.325 kPa (1 atm at sea level), 10–30 kPa (weather systems), 200–300 kPa (car tyre), 1 MPa (10 bar, compressed air), 20 MPa (scuba tank), 70 MPa (hydrogen storage).
kPa
Pressure must be greater than zero.
= 101.3 kPa = 1.013 bar = 1.000 atm = 14.70 psi
Volume (V) Volume occupied by the gas. Typical: 0.5 L (breath), 1 L (small bottle), 22.4 L (molar volume at STP), 50 L (car fuel tank vapour space), 1,000 L (1 m³, small tank), 50,000 L (50 m³, industrial vessel).
L
Volume must be greater than zero.
= 24.47 L = 0.02447 m³ = 24,470 cm³
Amount of Substance (n) Moles of gas present. 1 mol = 6.022 × 10²³ molecules (Avogadro's number) = molar mass in grams (e.g. 32 g of O₂, 28 g of N₂, 44 g of CO₂). Typical: 0.04 mol (a breath), 1 mol (molar reference), 10 mol (small cylinder), 400 mol (industrial batch).
mol
Amount must be greater than zero.
= 1.000 mol = 6.022 × 10²³ molecules
Absolute Temperature (T) Absolute temperature in kelvin (0 K = −273.15 °C). Must be positive — the ideal gas law breaks down as T → 0. Typical: 77 K (liquid nitrogen), 195 K (dry ice, −78 °C), 273.15 K (0 °C, ice point), 298.15 K (25 °C, standard lab), 373.15 K (100 °C, boiling water), 1,000 K (combustion).
K
Temperature must be greater than zero (absolute zero limit).
= 298.15 K = 25.00 °C = 77.00 °F
PRESSURE (P)
101.3 kPa
101.3 kPa · 1.000 atm · 14.70 psi
STANDARD ATMOSPHERIC PRESSURE
P · V = n · R · T
Step-by-step solution
Pressure vs volume (Boyle's law)
T × 0.5 Current T T × 2.0
Pressure scale gauge
Pressure vs temperature (Gay-Lussac's law)
V × 0.5 Current V V × 2.0
Sensitivity
Companion kinetic-theory metrics
Piston-cylinder gas system — live schematic
PISTON-CYLINDER · P · V = n · R · T PISTON P = 101.3 kPa T = 298 K V = 24.5 L n = 1.000 mol P · V = n · R · T → 101.3 kPa × 24.47 L = 1.000 × 8.314 × 298.15
Pressure P pushing the piston Volume V of gas below the piston Absolute temperature T in kelvin
What the ideal gas law really measures
P · Vpressure × volume
=
n · R · Tmoles · gas constant · temperature

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

L
mol
K
= 101.3 kPa · 1.000 atm · 14.70 psi

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.

UnitsValue of RCommon use
J/(mol·K) (SI)8.314462618Thermodynamics, energy calculations
kPa·L/(mol·K)8.314462618This calculator — conveniently equal to SI form
Pa·m³/(mol·K)8.314462618Base SI units
atm·L/(mol·K)0.082057Classical chemistry — standard reference
bar·L/(mol·K)0.083145Industrial gas processes
mmHg·L/(mol·K)62.364Medical and vacuum applications
cal/(mol·K)1.98720Classical thermodynamics
L·torr/(mol·K)62.364Torr = mmHg
ft·lbf/(lbmol·°R)10.7316US customary engineering

Standard Reference Conditions

The ideal gas law's predictions depend on which reference temperature and pressure are chosen.

ConditionT (K)P (kPa)Molar volume (L/mol)
STP (IUPAC 1982+)273.15100.00022.711
STP (traditional)273.15101.32522.414
SATP (IUPAC)298.15100.00024.789
NTP (Normal)293.15101.32524.055
Standard lab (25 °C, 1 atm)298.15101.32524.465
ISO 13443 natural gas288.15101.32523.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).

GasFormulaMolar mass (g/mol)R_spec (J/(kg·K))Density at 25 °C, 1 atm (kg/m³)
HydrogenH₂2.0164,1240.0824
HeliumHe4.0032,0770.1636
NitrogenN₂28.01296.81.145
Air (dry)—28.97287.01.184
OxygenO₂32.00259.81.308
ArgonAr39.95208.11.633
Carbon dioxideCO₂44.01188.91.799
MethaneCH₄16.04518.30.656
AmmoniaNH₃17.03488.20.696
Water vapourH₂O18.02461.50.737
PropaneC₃H₈44.10188.61.803
Sulphur hexafluorideSF₆146.0656.925.971

Unit Conversions for P, V and T

QuantityUnitEquivalent in SI / common form
Pressure1 Pa1 N/m² = 1 × 10⁻³ kPa
Pressure1 kPa1,000 Pa = 0.01 bar = 0.00987 atm
Pressure1 bar100 kPa = 0.987 atm = 14.504 psi
Pressure1 atm101.325 kPa = 1.01325 bar = 14.696 psi = 760 torr
Pressure1 psi6.895 kPa = 0.06895 bar
Pressure1 torr (mmHg)0.13332 kPa
Volume1 L1 dm³ = 0.001 m³ = 1,000 cm³ = 1,000 mL
Volume1 m³1,000 L = 1 × 10⁶ cm³
Volume1 ft³28.317 L = 0.028317 m³
Volume1 US gal3.7854 L
Volume1 imp gal4.5461 L
TemperatureT(K)T(°C) + 273.15
TemperatureT(°C)T(K) − 273.15
TemperatureT(°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:

P · V = n · R · T

Rearranged to solve for the other three variables:

P = n · R · T ÷ V
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

SymbolMeaningCommon units
PAbsolute pressurekPa, bar, atm, psi, Pa
VVolumeL, m³, cm³, ft³
nAmount of substance (moles)mol, kmol, mmol
RUniversal gas constant8.314 J/(mol·K) = 8.314 kPa·L/(mol·K)
TAbsolute temperatureK (kelvin)
NNumber of molecules = n · NAdimensionless (count)
ρMass density = nM / V = PM / (RT)kg/m³
MMolar massg/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

Given: n = 1 mol, T = 298.15 K, V = 24.47 L — solve for P
P = nRT / V = 1 × 8.314 × 298.15 / 24.47
P = 101.3 kPa = 1.000 atm
Given: P = 200 kPa, n = 2 mol, T = 300 K — solve for V
V = nRT / P = 2 × 8.314 × 300 / 200
V = 24.94 L
Given: P = 101.325 kPa, V = 1 L, T = 273.15 K (STP) — solve for n
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)
Given: P = 500 kPa, V = 10 L, n = 2 mol — solve for T
T = PV / (nR) = 500 × 10 / (2 × 8.314)
T = 300.7 K = 27.6 °C
Given: A gas at 25 °C, 1 atm occupies 1 L — what is its volume at 100 °C, same P?
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.

Calculating...

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