The Ideal Gas Law

The Ideal Gas Law

11 min read Updated Mar 26, 2026

All four individual gas laws are just special cases of one master equation. The ideal gas law combines Boyle’s, Charles’s, Gay-Lussac’s, and Avogadro’s laws into a single relationship that describes how any ideal gas behaves under any conditions. This is the most important equation in the entire gas phase chapter.

The Equation

Venn diagram showing how all gas laws relate to the ideal gas law PV/TN = kB. Color-coded regions show which variables each law holds constant: Boyle (blue, constant T and N), Charles (cyan, constant P and N), Gay-Lussac (green, constant V and N), Avogadro (orange, constant T and P), combined (pink), and ideal (gray).
How the individual gas laws relate to the ideal gas law. Each named law holds certain variables constant while describing the relationship between the remaining variables. Credit: Wikimedia Commons, CC BY-SA 4.0

The Gas Constant R

The value of R depends on the units you are using:

R ValueUnitsWhen to Use
0.0821L·atm/(mol·K)When P is in atm and V is in L (most common on MCAT)
8.314J/(mol·K)When working with energy (thermodynamics, kinetics)
62.36L·torr/(mol·K)When P is in torr (rarely needed)

For gas law problems, use R = 0.0821 almost every time. The value R = 8.314 J/(mol·K) shows up in thermodynamics equations like ΔG = ΔG° + RTlnQ and the Arrhenius equation.

Assumptions of the Ideal Gas Model

The ideal gas law works perfectly only for an “ideal” gas - a theoretical gas that:

  1. Has no intermolecular forces. Molecules do not attract or repel each other.
  2. Has no molecular volume. Molecules are treated as dimensionless points.
  3. Undergoes perfectly elastic collisions. No kinetic energy is lost when molecules collide.

No real gas is truly ideal, but most gases behave nearly ideally at high temperatures and low pressures (when molecules are far apart and moving fast). We will revisit when this model breaks down in Section 8.12 on real gases.

Calculating Molar Mass from Gas Data

The ideal gas law lets you determine the molar mass of an unknown gas. Start with PV = nRT and substitute n = mass/molar mass:

PV = (m/M)RT

Rearranging:

M = mRT / (PV)

Or, since density d = m/V:

Gas Density

From d = PM/(RT), you can see that:

  • Heavier gases are denser (higher M = higher d). CO2 (M = 44) is denser than N2 (M = 28), which is why CO2 sinks and accumulates in low areas.
  • Higher pressure increases density (compressing gas into less space).
  • Higher temperature decreases density (molecules spread out). This is why hot air rises - it is less dense than the surrounding cooler air.

Worked Example

What volume does 2.0 mol of an ideal gas occupy at 546 K and 2.0 atm?

PV = nRT

V = nRT/P = (2.0 mol)(0.0821 L·atm/mol·K)(546 K) / (2.0 atm)

V = (2.0)(0.0821)(546) / 2.0

Estimate: 0.0821 x 546 is roughly 0.08 x 550 = 44. Then 2 x 44 / 2 = 44.8 L

Notice: 2 mol at STP would be 44.8 L. This gas is at double the temperature (546 vs. 273) and double the pressure (2 vs. 1) compared to STP. The temperature doubles the volume (Charles’s law), but the pressure halves it (Boyle’s law). The two effects cancel, giving the same 44.8 L. Proportional reasoning confirms the algebra.

A 4.4 g sample of gas occupies 2.24 L at STP. What is the molar mass and likely identity of the gas?
Click to reveal answer
M = 44 g/mol - the gas is CO2. At STP, 2.24 L = 0.1 mol (since 22.4 L = 1 mol). Molar mass = 4.4 g / 0.1 mol = 44 g/mol. Common gases with M = 44: CO2 (12 + 32 = 44), N2O (28 + 16 = 44), or C3H8 (propane, 36 + 8 = 44). In a general chemistry context, CO2 is the most likely answer.
Two gas containers at the same temperature and pressure contain the same number of moles. Container A holds H2 and Container B holds O2. Which has the greater density?
Click to reveal answer
Container B (O2). Since d = PM/(RT), and P, R, and T are the same for both, density depends only on molar mass. O2 (M = 32) has a molar mass 16 times greater than H2 (M = 2), so O2 is 16 times denser. Both containers have the same volume (Avogadro's law), but the O2 container has much more mass.