Ideal Gas Law (PV = nRT)
By Dr. Zubair Khalid, DVM, MS, PhD ·

The ideal gas law is the equation PV = nRT, which connects the pressure, volume, amount in moles, and absolute temperature of a gas through one proportionality constant. It describes a model gas whose particles take up no volume and interact only through perfectly elastic collisions.
That model is physically impossible and scientifically indispensable. The same equation sizes a scuba tank, predicts the volume of carbon dioxide released by a yeast culture, converts a blood gas partial pressure into a dissolved oxygen concentration, and serves as the starting point for the kinetic molecular theory that explains why gases behave the way they do. Learning it well means learning unit discipline, the difference between a law and a theory, and the boundary between a useful approximation and a wrong answer.
The Ideal Gas Law Equation, Symbol by Symbol
| Symbol | Quantity | Typical units | What trips people up |
|---|---|---|---|
| P | Pressure | atm, kPa, Pa, torr, mmHg | Must be paired with the matching form of R |
| V | Volume | L, mL, m³ | Liters pair with 0.08206 L·atm/(mol·K) |
| n | Amount of substance | mol | Mass divided by molar mass, not mass itself |
| R | Ideal gas constant | Several valid values | Choose the one whose units cancel yours |
| T | Absolute temperature | K | Kelvin only, never Celsius or Fahrenheit |
The equation has four variables, so specifying any three fixes the fourth. Rearranged forms matter in practice:
- n = PV / RT (find moles from a container)
- P = nRT / V (predict pressure after a change)
- M = mRT / PV (find molar mass from a measured density)
- d = PM / RT (find density from pressure and temperature)
The density form is the one most often used in analytical work, because weighing a gas is hard and weighing the flask is easy.
Special Cases and the Combined Gas Law
Boyle's law, Charles's law, Gay-Lussac's law, and Avogadro's law are not separate principles. Each is the ideal gas law with some variables pinned.
- Boyle's law (constant n and T): P₁V₁ = P₂V₂
- Charles's law (constant n and P): V₁/T₁ = V₂/T₂
- Gay-Lussac's law (constant n and V): P₁/T₁ = P₂/T₂
- Avogadro's law (constant P and T): V₁/n₁ = V₂/n₂
The combined gas law P₁V₁/T₁ = P₂V₂/T₂ covers any change in conditions for a fixed amount of gas and is just the ideal gas law with nR cancelled on both sides.
What the Word "Ideal" Rules Out
An ideal gas has point-like particles with no intermolecular forces. Real molecules have finite size and attract one another, especially as they slow down. Deviations grow at high pressure (particles packed close enough for their own volume to matter) and at low temperature (attractive forces have time to act, and the gas approaches condensation). Large, polar molecules such as water vapor deviate more than small nonpolar ones such as helium. The van der Waals equation adds two correction terms to the ideal gas law, (P + an²/V²)(V - nb) = nRT, where a accounts for attraction and b for molecular volume. At ordinary laboratory pressures and well above the boiling point, the ideal gas law is accurate to a few tenths of a percent for most gases.
The Ideal Gas Constant and Its Values
The ideal gas constant R is defined by the relationship itself, R = PV/(nT). Its numerical value follows from any accurately known set of conditions. At standard temperature and pressure (273.15 K and 1 atm), one mole of an ideal gas occupies 22.414 L. Dividing gives:
R = (1 atm)(22.414 L) / [(1 mol)(273.15 K)] = 0.08206 L·atm/(mol·K)
Multiplying by the conversion factor 101.325 J per L·atm gives 8.314 J/(mol·K), which is the same number in SI base units.
| Value of R | Units | Use when |
|---|---|---|
| 0.08206 | L·atm/(mol·K) | P in atm, V in L (most common in general chemistry) |
| 8.314 | J/(mol·K), also kPa·L/(mol·K) | P in kPa and V in L, or energy calculations |
| 8.314 | Pa·m³/(mol·K) | Strict SI, P in Pa, V in m³ |
| 62.36 | L·torr/(mol·K) | P in torr or mmHg, V in L |
| 0.08314 | L·bar/(mol·K) | P in bar |
| 1.987 | cal/(mol·K) | Thermochemistry in calories |
All of these are the same physical constant expressed in different unit systems. A pressure of 1 atm equals 101.325 kPa, 760 torr, 760 mmHg, and 14.696 psi. A volume of 1 L equals 1000 mL and 0.001 m³. Temperature in kelvin equals degrees Celsius plus 273.15.
Where the Law Comes From: Kinetic Molecular Theory
The kinetic molecular theory (KMT) explains gas behavior by treating a gas as a large number of tiny particles in constant random motion. Standard textbook treatments state five assumptions [1][2]:
- A gas is composed of particles whose total volume is negligible compared with the container.
- Particles move in straight lines until they collide.
- Collisions with each other and with the walls are perfectly elastic, so kinetic energy is conserved.
- There are no attractive or repulsive forces between particles except during a collision.
- The average translational kinetic energy of the particles is directly proportional to the absolute temperature.
Assumption 3 is what makes the model tractable. Assumption 4 is what makes it ideal, and it is the one real gases break first. Model-building sequences in chemistry curricula introduce these assumptions explicitly so that students can see the theory as a set of choices rather than a fact sheet [3].
Deriving PV = nRT in Six Steps
A derivation makes the equation memorable and shows why pressure depends on the square of molecular speed rather than on speed itself.
- Place N particles, each of mass m, in a cube with side length L.
- Consider one particle moving along the x direction with speed vₓ. It strikes a wall and rebounds elastically, so its momentum changes by 2mvₓ.
- The particle crosses the cube and returns in time Δt = 2L/vₓ. The average force it exerts on that wall is 2mvₓ/Δt = mvₓ²/L.
- Summing over all particles gives a total force on the wall of (m/L)Σvₓ². On average, one third of the motion lies along each axis, so Σvₓ² = (1/3)Σv².
- Pressure is force divided by wall area L², so P = (1/3)(N/V)m⟨v²⟩, where ⟨v²⟩ is the mean square speed.
- The average translational kinetic energy is ½m⟨v²⟩ = (3/2)k_BT, where k_B is the Boltzmann constant. Substituting m⟨v²⟩ = 3k_BT gives P = Nk_BT/V. Since N = nN_A and R = N_Ak_B, this becomes PV = nRT.
The root-mean-square speed follows directly: v_rms = √(3RT/M), where M is molar mass in kg/mol. For nitrogen at 298 K, v_rms = √(3 × 8.314 × 298 / 0.028) ≈ 515 m/s. That is faster than the speed of sound in the same gas, which is one reason the theory works so well for diffusion and heat conduction in dilute gases.
Ideal Gas Law Units: Getting the Bookkeeping Right
Unit errors account for most lost points on gas problems, and most of those errors are avoidable with a fixed procedure.
Match R to P and V. Choose the row of the R table that uses the units you already have, or convert your data to match a preferred R. Do not mix, for example, pressure in kPa with R = 0.08206.
Convert temperature first. A gas at 27 °C is at 300.15 K, not at 27 K. Doubling from 27 °C to 54 °C raises the absolute temperature by only about 9 percent, so the volume rises by about 9 percent, not 100 percent.
Convert mass to moles. Divide grams by molar mass in g/mol. For 8.0 g of oxygen gas, O₂ has a molar mass of 32.0 g/mol, so n = 0.25 mol.
Know which standard you mean. At 273.15 K and 1 atm, the molar volume of an ideal gas is 22.414 L. At 298.15 K and 1 atm it is 24.45 L. Many physiology and engineering texts use the second value.
Watch prefixes. Kilopascal means 1000 Pa, so a reading of 101.3 kPa is 101,300 Pa. Using 8.314 with kPa and liters works because kPa·L has the same dimensions as Pa·m³.
Worked Ideal Gas Law Examples
Example 1: Moles of Gas in a Balloon

A balloon holds 2.00 L at 298 K and 1.00 atm. How many moles of gas does it contain?
n = PV/RT = (1.00 atm × 2.00 L) / (0.08206 L·atm/(mol·K) × 298 K) = 0.0818 mol
Example 2: Pressure in a Sealed Flask After Heating
A rigid 5.00 L flask contains 0.200 mol of gas at 300 K. What is the pressure, and what does it become at 400 K?
Initial: P = nRT/V = (0.200 × 0.08206 × 300) / 5.00 = 0.985 atm
Because n and V are fixed, pressure scales with absolute temperature: P₂ = 0.985 atm × (400/300) = 1.31 atm. The flask must be rated for that pressure.
Example 3: Molar Mass from Gas Density
An unknown gas has a density of 1.25 g/L at 1.00 atm and 273 K. What is its molar mass?
M = dRT/P = (1.25 g/L × 0.08206 L·atm/(mol·K) × 273 K) / 1.00 atm = 28.0 g/mol
That value is consistent with nitrogen or carbon monoxide, which cannot be distinguished by this measurement alone. Density gives molar mass, not identity.
Example 4: Volume Ratios in a Reaction
Avogadro's law states that equal volumes of gases at the same temperature and pressure contain equal numbers of molecules. For 2H₂ + O₂ → 2H₂O, 3.00 L of hydrogen reacts completely with 1.50 L of oxygen at the same conditions, because the coefficients are also volume ratios for gases. The ideal gas law is what licenses that shortcut.
Designing an Ideal Gas Law Worksheet
A worksheet that mixes difficulty levels without warning teaches students to pattern-match rather than reason. A better sequence moves through tiers.
Tier 1, unit drills. Convert 745 mmHg to atm, 25.0 °C to K, 250 mL to L, and 4.4 g of CO₂ to moles.
Tier 2, single-state solves. Given three of P, V, n, T, find the fourth. Vary which variable is unknown and which unit system appears.
Tier 3, two-state problems. Fixed amount of gas, changing conditions. Require the combined gas law or a ratio approach, then ask for a physical sanity check.
Tier 4, derived quantities. Density, molar mass, and stoichiometry with gas volumes.
Tier 5, judgment problems. Ask whether the ideal gas law is appropriate at 200 atm and 250 K, or for water vapor at 95 °C near saturation.
A short practice set that covers tiers 2 through 4:
- Find the volume of 0.500 mol of gas at 350 K and 0.950 atm. (15.1 L)
- A 250 mL sample at 1.00 atm is compressed to 100 mL at constant temperature. What is the new pressure? (2.50 atm)
- What is the density of carbon dioxide at 1.00 atm and 273 K? (1.96 g/L)
- How many moles of gas occupy 44.8 L at 273 K and 1.00 atm? (2.00 mol)
- A gas with a molar mass of 44.0 g/mol is held at 300 K and 1.00 atm. What is its density? (1.78 g/L)
Using an Ideal Gas Law Calculator Without Fooling Yourself

An ideal gas law calculator solves for the missing variable, but it cannot detect a mismatched unit or a Celsius input. Before trusting any output, confirm five things:
- The temperature field is in kelvin. Some calculators accept Celsius and convert, and some do not.
- The pressure and volume units correspond to the R value displayed by the tool.
- The amount is in moles, not grams.
- The gas is far enough from its boiling point and low enough in pressure that the ideal assumption holds.
- The answer has sensible magnitude. One mole at room conditions occupies roughly 24 L, so a result of 0.002 L or 2400 L for a bench-scale setup signals an error.
Misconceptions That Survive Instruction
Students do not arrive at gas laws as blank slates, and many incorrect ideas persist after instruction. Research on university students' reasoning about kinetic molecular theory has documented persistent difficulty with the concept of gas pressure and with the volume occupied by an ideal gas [4][5]. Those two ideas are the foundation of the derivation, so a shaky grasp there undermines everything built on top.
Concept inventories confirm how broad the problem is. In a study of 223 university students in Kazakhstan, 81.2 percent held incorrect conceptions about entropy and 80.3 percent misunderstood temperature behavior during adiabatic processes [6]. Work on a kinetic molecular theory inventory for liquids found additional misconceptions about internal energy, temperature, and pressure that had not been reported earlier, including confusion about how thermal energy relates to particle motion [7].
Representation matters as well. When tenth-grade chemistry students were taught through an integrated macro-micro-symbolic approach, their understanding improved from good at the macroscopic and microscopic levels to very good at the symbolic level, which suggests that symbolic fluency can outrun physical understanding unless instruction deliberately connects them [8]. Teaching gas laws and kinetic molecular theory together also helps students distinguish a scientific law from a theory and from a hypothesis, a distinction that is easy to state and hard to learn [9].
The most common specific errors:
- Treating pressure as something a gas "has" rather than a result of collisions with container walls.
- Believing that doubling the volume doubles the pressure.
- Using Celsius in any ratio calculation.
- Confusing the number of particles N with the number of moles n.
- Thinking that heavier gas molecules move faster at the same temperature. At fixed temperature, all gases have the same average kinetic energy, so heavier molecules move more slowly.
Where the Law Appears in Practice
In respiratory physiology, the number of oxygen molecules in a breath follows n = PV/RT. Because atmospheric pressure falls with altitude, the partial pressure of oxygen falls with it, even though the fraction of oxygen in air stays at about 0.21. That drop, not a change in air composition, is why hemoglobin saturation declines at high elevation. The alveolar gas equation, used to estimate oxygen partial pressure in the lung, is built from the same ideal gas relationships plus a correction for water vapor and carbon dioxide production.
In laboratory work, the law converts measured gas volumes to moles so that stoichiometry can proceed. A fermentation experiment that captures 1.2 L of carbon dioxide over water at room temperature can report a molar yield only after correcting for water vapor pressure and applying PV = nRT.
In engineering, the law sizes compressed gas storage. A cylinder rated to 200 atm holds roughly 200 times the moles of gas that the same volume would hold at 1 atm, which is why a scuba tank that feels empty still contains a substantial mass of air.
The law also has a quantum edge. A 2025 study tested the ideal gas law for a single quantum particle confined in a two-dimensional cavity and found that it holds exactly for isotropic geometries such as a circular billiard, while anisotropic geometries obey it only on average, with deviations reduced by chaotic dynamics and by coherent states [10]. The classical law thus emerges as a statistical limit rather than a fundamental truth.
Common Mistakes and Limitations
- Celsius in the denominator. The single most common error. Convert to kelvin before doing anything else.
- R with mismatched units. R = 0.08206 requires atm and liters. R = 8.314 requires kPa and liters, or Pa and cubic meters.
- Mass entered as moles. Divide by molar mass in g/mol first.
- Adding pressures without checking phases. In a mixture with liquid water present, the gas phase contains water vapor at its vapor pressure, and the dry gas pressure is the total minus that contribution.
- Applying the law near condensation. A gas within about 20 K of its boiling point can deviate substantially from ideal behavior, and below the critical temperature it can liquefy entirely.
- High-pressure extrapolation. At hundreds of atmospheres, molecular volume and intermolecular attraction both matter, and the ideal gas law underestimates or overestimates depending on conditions.
- Forgetting that the law is a limit. The kinetic molecular theory behind it assumes dilute, noninteracting particles, an assumption that kinetic treatments of dense or granular systems must modify with additional physics [11].
- Significant figures from calculator output. Eight digits from a calculator do not become eight reliable measurements. Report according to the least precise input.
Quick Review
- PV = nRT relates pressure, volume, moles, and absolute temperature in one equation.
- T must be in kelvin. K = °C + 273.15.
- R = 0.08206 L·atm/(mol·K) = 8.314 J/(mol·K) = 62.36 L·torr/(mol·K).
- Boyle, Charles, Gay-Lussac, and Avogadro laws are all special cases with variables held constant.
- The law comes from kinetic molecular theory, deriving pressure as particle collisions with the walls.
- Average kinetic energy depends only on temperature, so v_rms = √(3RT/M).
- The model breaks down at high pressure, low temperature, and near condensation.
Gas Mixtures and Partial Pressures: Dalton's Law in the Lab
Dalton's law of partial pressures states that the total pressure of a mixture of nonreacting gases equals the sum of the pressures each gas would exert alone in the same volume. For gases A, B, and C:
P_total = P_A + P_B + P_C
Each P_i is a partial pressure. The partial pressure of a component is directly proportional to its mole fraction, X_i = n_i / n_total. Because all gases in a mixture share the same volume and temperature, the ideal gas law gives:
P_i = X_i × P_total
This relation is what makes gas mixtures tractable: each component behaves as if it alone occupied the container, and the total pressure is simply the sum of those independent contributions.
Collecting a Gas over Water

A standard way to measure the volume of a gas produced in a reaction is to collect it over water in an inverted graduated cylinder. The gas displaces water, and the space above the water contains both the product gas and water vapor. The total pressure inside the cylinder equals the ambient atmospheric pressure, so:
P_atm = P_dry_gas + P_water_vapor
The dry gas pressure is what must be used in PV = nRT. The vapor pressure of water depends only on temperature and is tabulated in reference data: 17.5 torr at 20 °C, 23.8 torr at 25 °C, and 149 torr at 60 °C.
Worked Example
A student collects oxygen gas over water at 24 °C and a barometric pressure of 752 torr. The collected volume is 0.385 L. How many moles of dry oxygen were collected?
At 24 °C, the vapor pressure of water is 22.4 torr.
P_dry = 752 torr - 22.4 torr = 729.6 torr = 0.960 atm
n = PV/RT = (0.960 atm × 0.385 L) / (0.08206 L·atm/(mol·K) × 297 K) = 0.0152 mol
The Common Mistake
The most frequent error in gas-over-water problems is substituting the total barometric pressure into PV = nRT without subtracting the water vapor pressure. That mistake overestimates the moles of dry gas, because the water vapor's contribution is counted as product gas. The error grows with temperature, since the vapor pressure of water rises sharply from 17.5 torr at 20 °C to 149 torr at 60 °C. Near the boiling point, using total pressure instead of dry gas pressure can overestimate the amount of gas by 20 percent or more.
Real Gases: Quantifying Deviations with the van der Waals Equation
The ideal gas law treats molecules as point particles with no intermolecular forces. Real molecules have finite size and attract one another, so the law fails when those assumptions break down. At high pressure, molecules are packed closely enough that their own volume becomes a significant fraction of the container. At low temperature, molecules move slowly and attractions have time to act, pulling the gas toward condensation. The van der Waals equation adds two corrections:
(P + an²/V²)(V - nb) = nRT
The pressure correction an²/V² accounts for intermolecular attraction. Attraction between molecules weakens their impact on the container walls, so the measured pressure is lower than the ideal pressure; adding the term to P recovers the ideal value. The volume correction nb accounts for the space the molecules themselves occupy, leaving V - nb as the free volume. The constants a and b are empirical values specific to each gas, determined by fitting to experimental data. Large, polar molecules such as water vapor have large a values, and bulky molecules have large b values.
Ideal versus Real Pressure for Carbon Dioxide
For CO₂, a = 3.59 L²·atm/mol² and b = 0.0427 L/mol. Rearranging the van der Waals equation to solve for pressure gives P = nRT/(V - nb) - an²/V². At 300 K with 1.00 mol of gas:
| Volume (L) | P_ideal (atm) | P_van der Waals (atm) | Deviation |
|---|---|---|---|
| - | - | - | - |
| 1.00 | 24.6 | 22.1 | 10% |
| 10.0 | 2.46 | 2.44 | 1.0% |
| 100 | 0.246 | 0.246 | 0.1% |
At V = 1.00 L, the calculation gives P = (1.00)(0.08206)(300)/(1.00 - 0.0427) - (3.59)(1.00)²/(1.00)² = 22.1 atm, about 10% below the ideal value of 24.6 atm. The volume correction raises the pressure because the molecules occupy a measurable fraction of the container, while attraction lowers it. At 10 L the corrections nearly cancel, and at 100 L the gas is effectively ideal. At very high pressure the volume term dominates and the real pressure exceeds the ideal value.
The correction matters whenever a gas is compressed or cooled toward its boiling point. It is negligible for most laboratory measurements near 1 atm and well above the boiling point, where the ideal gas law remains the practical choice. The van der Waals equation is itself an approximation; more accurate equations of state exist, but it captures the dominant deviations with only two parameters.
Gas Stoichiometry: From Balanced Equations to Gas Volumes
Balanced chemical equations give mole ratios, not volume ratios. For gases, the ideal gas law supplies the bridge: n = PV/RT converts a measured volume to moles, and V = nRT/P converts moles back to a volume at any chosen conditions.
When all gases in a reaction share the same temperature and pressure, Avogadro's law makes the shortcut valid: volume ratios equal mole ratios. For 2CO + O₂ → 2CO₂, 4.0 L of carbon monoxide reacts with 2.0 L of oxygen at the same conditions, because the coefficient ratio 2:1 applies directly to volumes. No PV = nRT calculation is needed.
The shortcut fails when conditions differ. Consider N₂ + 3H₂ → 2NH₃. Suppose 8.0 L of N₂ at 2.0 atm and 300 K reacts with 12.0 L of H₂ at 1.0 atm and 300 K. The volumes cannot be compared directly because the pressures differ. Convert each to moles:
n(N₂) = (2.0 atm × 8.0 L) / (0.08206 L·atm/(mol·K) × 300 K) = 0.650 mol n(H₂) = (1.0 atm × 12.0 L) / (0.08206 × 300) = 0.487 mol
The reaction needs 3 mol H₂ per mol N₂, so 0.650 mol N₂ would require 1.95 mol H₂. Only 0.487 mol is present, so H₂ is limiting. The theoretical yield is:
0.487 mol H₂ × (2 mol NH₃ / 3 mol H₂) = 0.325 mol NH₃
At 1.0 atm and 273 K, that amount occupies:
V = (0.325 mol × 0.08206 × 273 K) / 1.0 atm = 7.28 L
The most common error in gas stoichiometry is applying volume ratios without checking conditions. Volume ratios are valid only when every gas is at the same temperature and pressure. If a problem states different conditions for reactants and products, or if it asks for a volume at STP when the reaction ran at other conditions, the only safe route is to convert each volume to moles with PV = nRT, use the balanced equation's mole ratios, and convert the final moles to volume with PV = nRT at the requested conditions. Also, never use the molar volume 22.4 L/mol unless the gas is actually at 273.15 K and 1 atm; at 298 K and 1 atm the molar volume is 24.5 L, and using the wrong value introduces a systematic error.
Related Guides
- Stroke Volume and Frank-Starling Law Explained: Another named scientific law used in physiology and veterinary science
- Frank-Starling Law: Cardiac Output Explained: Another physiology law example for comparing scientific law concepts
Frequently Asked Questions
What is the ideal gas law in simple terms?
It is the equation PV = nRT, which says that the pressure of a gas times its volume equals the amount of gas times a constant times the absolute temperature. Fix any three quantities and the fourth is determined.
Which value of the ideal gas constant should I use?
Use the value whose units cancel the pressure and volume units in your problem. Most general chemistry problems use 0.08206 L·atm/(mol·K), while problems with kilopascals or energy units use 8.314 J/(mol·K).
Why must temperature be in kelvin?
Gas relationships are proportional to absolute temperature, whose zero point is the temperature at which molecular motion reaches its minimum. Celsius has an arbitrary zero, so it cannot be used in ratios or in the equation itself.
When does the ideal gas law fail?
It fails when particles are close enough for their own volume and their mutual attractions to matter. High pressure, low temperature, and large or polar molecules all push a gas away from ideal behavior.
How do I approach ideal gas law practice problems?
Convert every quantity to a consistent unit set first, identify which variable is unknown, rearrange the equation, and substitute. Check the answer for plausible magnitude, since one mole of gas occupies about 24 L at room conditions.
Is the ideal gas law exact for a single quantum particle?
No, and the details depend on geometry. A 2025 study found the law holds exactly in isotropic two-dimensional cavities, while anisotropic ones obey it only on average, with deviations shrinking as dynamics become chaotic [10].
Sources
- 9.5 The Kinetic-Molecular Theory
- The Kinetic-Molecular Theory
- 5.3.3 Kinetic molecular theory: Model development
- University student reasoning about the basic tenets of kinetic-molecular theory, Part II: Pressure of an ideal gas
- University student and K-12 teacher reasoning about the basic tenets of kinetic-molecular theory, Part I: Volume of an ideal gas
- Exploring university students’ misconceptions of the kinetic molecular theory of gases: A study from Kazakhstan
- Development of the kinetic molecular theory of liquids concept inventory: preliminary results on university students’ misconceptions
- Understanding of Kinetic Molecular Theory of Gases in Three Modes of Representation among Tenth-Grade Students in Chemistry
- Theories, Laws, and Hypotheses: Teaching Overarching Science Concepts through Gas Laws and Kinetic Molecular Theory
- Ideal gas law for a quantum particle.
- Kinetic theory of granular particles immersed in a molecular gas