Skip to main content
← BlogThermodynamics

Ideal Gas Law PV = nRT: What R Is, Derivation & 4 Worked Examples

Physics Fundamentals Editorial TeamPhysics FundamentalsUpdated Jun 20, 202614 min read
Ideal gas law — piston compressing gas in a cylinder illustrating the relationship between pressure, volume, and temperature

Every breath you take, every balloon you inflate, every weather system on Earth obeys one elegant equation: PV = nRT. The ideal gas law connects the pressure, volume, temperature, and quantity of a gas in a single relationship. Master it and you can predict how any gas behaves under changing conditions — whether you're calculating tyre pressure on a cold morning, designing a piston engine, or understanding how the atmosphere thins at altitude.

The Ideal Gas Law: PV = nRT

P = pressure (Pa or N/m²)
V = volume (m³)
n = amount of gas (moles, mol)
R = 8.314 J mol⁻¹ K⁻¹ — the universal gas constant
T = absolute temperature (kelvin — never Celsius)

An ideal gas is one where molecules have negligible volume and no intermolecular forces except during elastic collisions.

What Is R in PV = nRT?

R is the universal gas constant, with value R = 8.314 J mol⁻¹ K⁻¹. It appears in almost every equation in thermodynamics and statistical mechanics. R is not specific to any particular gas — it applies equally to hydrogen, oxygen, nitrogen, or any ideal gas.

Physically, R = N_A × k_B, where N_A = 6.022 × 10²³ mol⁻¹ is Avogadro's number and k_B = 1.381 × 10⁻²³ J K⁻¹ is Boltzmann's constant. This means PV = nRT and PV = Nk_BT are the same equation — the first counts gas in moles, the second in individual molecules.

The value R = 8.314 J mol⁻¹ K⁻¹ is determined by experiment and is the same for all ideal gases — that's why it's called "universal." At standard temperature and pressure (0°C, 1 bar), one mole of ideal gas occupies 22.711 litres, a directly verifiable consequence of PV = nRT.

Where PV = nRT Comes From

The ideal gas law synthesises three independently discovered experimental laws, each capturing how one pair of variables behaves when the others are fixed:

Boyle's Law (Robert Boyle, 1662): At constant T and n, P and V are inversely proportional — PV = constant, or P₁V₁ = P₂V₂. Compress a gas into half the volume and pressure doubles. The physical reason: the same number of molecules in a smaller space hit the walls more often.

Charles's Law (Jacques Charles, 1787): At constant P and n, volume is proportional to absolute temperature — V/T = constant, or V₁/T₁ = V₂/T₂. This is why hot air balloons work: heating air at constant pressure makes it expand, reducing its density below that of the surrounding cooler air.

Gay-Lussac's Law (Joseph Gay-Lussac, 1808): At constant V and n, pressure is proportional to absolute temperature — P/T = constant, or P₁/T₁ = P₂/T₂. This is why a sealed tyre has higher pressure in summer than winter, and why pressure cookers raise the boiling point of water by increasing internal pressure.

Combining all three: PV/T = constant for fixed n. Adding Avogadro's observation (equal volumes at same T and P contain equal numbers of moles) gives PV = nRT, where R is the universal proportionality constant.

Law Held constant Relationship Real-world example
Boyle's T, n P ∝ 1/V → P₁V₁ = P₂V₂ Compressing a syringe
Charles's P, n V ∝ T → V₁/T₁ = V₂/T₂ Hot air balloon
Gay-Lussac's V, n P ∝ T → P₁/T₁ = P₂/T₂ Tyre pressure in summer

How to Use PV = nRT: Step-by-Step

  1. Convert temperature to kelvin: T(K) = T(°C) + 273.15. Using Celsius is the most common error in gas law calculations.
  2. Convert pressure to Pa: 1 atm = 101,325 Pa; 1 bar = 100,000 Pa; 1 kPa = 1,000 Pa.
  3. Convert volume to m³: 1 litre = 0.001 m³; 1 cm³ = 10⁻⁶ m³.
  4. Identify the unknown and rearrange PV = nRT to isolate it.
  5. Substitute and calculate. Check units cancel correctly.

Worked Example 1: Finding Volume

2.0 mol of nitrogen gas at 300 K and pressure 1.5 × 10⁵ Pa. Find the volume.

V = nRT / P = (2.0 × 8.314 × 300) / (1.5 × 10⁵)
V = 4988.4 / 150,000 = 0.0333 m³ = 33.3 litres

Sense check: 1 mol at STP ≈ 22.4 L, so 2 mol at 300 K and 1.5 atm should give somewhat less than 44.8 L. Our answer of 33.3 L is consistent.

Worked Example 2: Boyle's Law — Compressed Gas

A sealed container holds gas at 2.0 × 10⁵ Pa in a volume of 0.50 m³. It is compressed isothermally to 0.20 m³. Find the new pressure.

P₁V₁ = P₂V₂ → P₂ = P₁V₁ / V₂ = (2.0 × 10⁵ × 0.50) / 0.20 = 5.0 × 10⁵ Pa

Volume fell to 40% of its original value, so pressure rose to 250% — inverse proportionality confirmed: (2.0 × 10⁵)(0.50) = (5.0 × 10⁵)(0.20) = 10⁵ Pa·m³.

Worked Example 3: Gay-Lussac's Law — Tyre Pressure

A car tyre has gauge pressure 2.20 × 10⁵ Pa at 15°C (288 K). After a long drive it reaches 55°C (328 K) at essentially constant volume. Find the new pressure.

P₂ = P₁ × T₂/T₁ = 2.20 × 10⁵ × (328/288) = 2.51 × 10⁵ Pa

A 14% increase — exactly why manufacturers say check tyre pressure when cold, and why racing engineers account for heat build-up when setting pre-race pressures.

Worked Example 4: Combined Gas Law

Gas starts at P₁ = 1.0 × 10⁵ Pa, V₁ = 0.010 m³, T₁ = 300 K. It is compressed to V₂ = 0.004 m³ and simultaneously heated to T₂ = 400 K. Find P₂ (n is constant).

P₁V₁/T₁ = P₂V₂/T₂ → P₂ = P₁V₁T₂ / (T₁V₂)
P₂ = (1.0 × 10⁵ × 0.010 × 400) / (300 × 0.004) = 400/1.2 = 3.33 × 10⁵ Pa

Two effects compound: compression factor 0.010/0.004 = 2.5; temperature factor 400/300 = 1.33. Combined: 2.5 × 1.33 = 3.33. ✓

PV = nRT and Molecular Kinetic Theory

The ideal gas law isn't just empirical — it can be derived from Newton's laws applied to gas molecules. Consider N molecules in a box. Each molecule bouncing off a wall exerts an impulse on it. Summing the average forces from all molecules, and using the result that average kinetic energy per molecule is (3/2)k_BT, yields:

PV = Nk_BT = nRT

This is explored in the kinetic theory of gases article. The key physical insight is that temperature is literally a measure of average molecular kinetic energy: at 300 K, nitrogen molecules move at roughly 515 m/s on average — faster than a bullet. Pressure is what you feel when billions of those molecules hit a wall every second.

Real vs Ideal: When PV = nRT Breaks Down

High pressure (above ~10 MPa for most gases): molecules are packed tightly enough that their finite volume matters — the effective volume available for motion is less than V. Intermolecular forces also begin to affect behaviour significantly.

Low temperature (near the boiling point): attractive forces dominate and the gas may liquefy. Near condensation, real behaviour diverges sharply from ideal predictions.

The van der Waals equation corrects for both: (P + an²/V²)(V − nb) = nRT. Here a corrects for attractions and b for finite molecular volume. For nitrogen at room conditions, corrections are below 1% at atmospheric pressure — perfectly safe to use the ideal gas law.

Real-World Applications

Internal combustion engines: the compression stroke squeezes the air-fuel mixture — small V gives large P by Boyle's Law. The power stroke releases combustion energy, dramatically increasing T and hence P (Gay-Lussac). Every stroke is a gas law calculation in action.

SCUBA diving: a tank holds air at ~200 atm. As a diver descends, ambient pressure increases (~1 atm per 10 m depth). PV = nRT determines exactly how much breathing air remains at each depth and pressure, which is critical for dive planning and safety.

Atmospheric science: combined with the hydrostatic equation, the ideal gas law gives the barometric formula: P = P₀ × e^(−Mgh/RT). This predicts pressure halving roughly every 5.5 km of altitude — matching observations closely and enabling weather forecasting models.

Weather balloons: a balloon launched at sea level expands as it rises (lower ambient pressure → larger volume at roughly constant T, by Boyle's Law). It bursts when V exceeds the material limit — typically at 30–40 km where pressure is less than 1% of sea-level value.

Molar mass determination: since n = m/M, PV = nRT rearranges to M = mRT/(PV). Measure the mass, pressure, volume, and temperature of an unknown gas sample and you can identify it by its molar mass. This technique confirmed molecular formulas for many gases in the 19th century and still appears in undergraduate chemistry labs today.

The Ideal Gas Law and the Ideal Gas Law Calculator

You can solve PV = nRT problems instantly using the ideal gas law calculator — enter any four variables and it returns the fifth. It also handles unit conversions automatically, which removes the main source of arithmetic errors in gas law problems.

Frequently Asked Questions

What is the ideal gas law PV = nRT?

PV = nRT is the ideal gas law, relating pressure (P in Pa), volume (V in m³), moles of gas (n), the universal gas constant R = 8.314 J mol⁻¹ K⁻¹, and absolute temperature (T in kelvin). It predicts how a gas responds to changes in any of these variables and is derived from combining Boyle's Law (P ∝ 1/V), Charles's Law (V ∝ T), and Gay-Lussac's Law (P ∝ T). Real gases approximate it well at high temperature and low pressure.

What is R in PV = nRT and what is its value?

R is the universal gas constant, equal to 8.314 J mol⁻¹ K⁻¹. It is the same for every ideal gas — hence "universal." Physically, R = N_A × k_B, the product of Avogadro's number (6.022 × 10²³ mol⁻¹) and Boltzmann's constant (1.381 × 10⁻²³ J K⁻¹). Its value is determined experimentally and represents the energy per mole per degree of temperature — it appears across thermodynamics, chemistry, and statistical mechanics.

Why must temperature be in kelvin in PV = nRT?

The gas laws require proportionality with temperature (V ∝ T, P ∝ T), which only works on an absolute scale starting at true zero — where molecular kinetic energy would theoretically reach zero. Celsius is an offset scale: 0°C does not mean zero kinetic energy, it's just the freezing point of water. Using Celsius in PV = nRT produces physically wrong results. Always convert: T(K) = T(°C) + 273.15. This is the most common calculation error students make with gas law problems.

What is an ideal gas and do ideal gases actually exist?

An ideal gas is a theoretical model in which molecules have negligible volume, no intermolecular forces except during elastic collisions, and random motion described by Maxwell-Boltzmann statistics. No real gas is perfectly ideal, but most gases at room temperature and atmospheric pressure behave nearly ideally — nitrogen, oxygen, and noble gases are all within 1–2% of ideal predictions under these conditions. Deviations become significant above ~10 atm pressure or near the boiling point of the gas.

What is Boyle's Law and how does it relate to PV = nRT?

Boyle's Law states that for a fixed amount of gas at constant temperature, pressure and volume are inversely proportional: P₁V₁ = P₂V₂. Double the pressure and the volume halves. It is simply PV = nRT with n, R, T held constant, so PV = constant. You can see this directly in everyday life: compressing a bicycle pump while blocking the outlet increases pressure as volume decreases.

When does the ideal gas law fail?

The ideal gas law fails at very high pressures (molecules are close enough that intermolecular forces and finite molecular volumes become significant) and very low temperatures (near the boiling point, where attractive forces cause condensation). The van der Waals equation — (P + an²/V²)(V − nb) = nRT — corrects for both effects. For typical engineering and chemistry at room temperature and atmospheric pressure, the ideal gas law is accurate to within 1–2%.

Share this article

Written by

Physics Fundamentals Editorial Team

Written and reviewed by our team of physics educators. Content is aligned with A-Level, GCSE, AP Physics, and undergraduate curricula.

About Physics Fundamentals →

Discussion

Comments

Leave a comment

Have a question about this article? Spot a mistake? Or just want to share your thoughts? We'd love to hear from you.

0/2000

Comments are moderated and appear after review. Be respectful and constructive.

Keep learning physics fundamentals

Get new articles and platform updates delivered to your inbox.

Physics Fundamentals

Channel · Updates only

👋 Get concise physics updates — new articles, calculators, and tools. Your number stays private. No spam. No group chats. Just worthy content.

Your number is never shared or visible to others

Join the Channel