The ideal gas law: PV = nRT

The ideal gas law PV = nRT unites all gas variables. Density, molar mass, R values, and worked molar-mass examples.

Quick answer

The ideal gas law, PV = nRT, relates all four gas variables at once: pressure, volume, moles, and absolute temperature, joined by the gas constant R. It assumes point-like particles with no attractions.

PV=nRTPV = nRT

Example: A 0.500 g sample of vapor in a 0.250 L flask at 1.00 atm and 400 K has molar mass M = mRT/(PV) = (0.500 × 0.08206 × 400)/(1.00 × 0.250) ≈ 65.6 g/mol.

What you will learn

  • State the ideal gas law and define each variable with units.
  • Select the correct R value for the given units.
  • Derive and use the density form d = PM/RT.
  • Determine molar mass from mass, P, V, and T measurements.

One equation for all four variables

The combined gas law handled changing conditions for a fixed sample, but it could not answer 'how many moles?' The ideal gas law promotes amount to a full variable:

PV=nRTPV = nRT

Pressure times volume equals moles times the gas constant times absolute temperature. One equation now links all four measurable properties of a gas, and every simple gas law falls out of it: hold nn and TT constant and PVPV is constant, which is Boyle's law, and so on.

The constant RR is the bridge between the macroscopic world of liters and atmospheres and the particulate world of moles. Its two essential forms are R=0.08206 L⋅atm/(mol⋅K)R = 0.08206\ \text{L·atm/(mol·K)} and R=8.314 J/(mol⋅K)R = 8.314\ \text{J/(mol·K)}. Choose by units, never by habit.

A worked example: what volume does 2.50 mol of gas occupy at 1.20 atm and 27∘C27^\circ\text{C} (300 K)? V=nRT/P=(2.50×0.08206×300)/1.20=51.3V = nRT/P = (2.50 \times 0.08206 \times 300)/1.20 = 51.3 L. Three multiplications and a division replace an entire chain of proportional reasoning.

Density from the law: d = PM/RT

Substitute n=m/Mn = m/M, mass over molar mass, into PV=nRTPV = nRT and rearrange:

d=PMRTd = \frac{PM}{RT}

where dd is density in mass per volume. Gas density is directly proportional to pressure and molar mass, and inversely proportional to temperature. This is why hot-air balloons float and why cold air sinks.

A worked example: what is the density of air at STP? Air averages M≈29M \approx 29 g/mol. d=PM/RT=(1.00×29)/(0.08206×273.15)=29/22.41≈1.29d = PM/RT = (1.00 \times 29)/(0.08206 \times 273.15) = 29/22.41 \approx 1.29 g/L. Now heat that air to 100∘C100^\circ\text{C} (373 K) at the same pressure: d=29/(0.08206×373)≈0.948d = 29/(0.08206 \times 373) \approx 0.948 g/L, about 27 percent lighter. A balloon envelope full of that hot air displaces 1.29 g/L of outside air while weighing only 0.948 g/L inside, and the difference is lift.

Weighing the invisible: molar mass from vapor

The same substitution solved for MM turns the gas law into an analytical instrument:

M=mRTPVM = \frac{mRT}{PV}

Vaporize a weighed sample of an unknown volatile liquid in a flask of known volume, record PP and TT, and the molar mass drops out. This is the Dumas method, nearly two centuries old and still taught because it works.

A worked example: 0.500 g of an unknown liquid vaporizes completely in a 0.250 L flask at 1.00 atm and 127∘C127^\circ\text{C} (400 K). M=mRT/(PV)=(0.500×0.08206×400)/(1.00×0.250)=16.41/0.250≈65.6M = mRT/(PV) = (0.500 \times 0.08206 \times 400)/(1.00 \times 0.250) = 16.41/0.250 \approx 65.6 g/mol. That molar mass narrows the identity dramatically: among common solvents it sits near 2-propanol at 60.1 g/mol or acetic acid at 60.05, close enough to guide the next test. The method needs only a balance, a flask, and a thermometer.

Stoichiometry with gases

Gas stoichiometry runs on the law too. Reactions that involve gases quote amounts in liters, but balanced equations speak in moles, and PV=nRTPV = nRT is the translator.

A worked example: how many liters of oxygen at STP are needed to burn 10.0 g of methane? The equation CH4+2O2→CO2+2H2O\text{CH}_4 + 2\text{O}_2 \rightarrow \text{CO}_2 + 2\text{H}_2\text{O} demands 2 mol O2 per mol CH4. Moles of methane: 10.0/16.04=0.62310.0/16.04 = 0.623 mol, so oxygen needed: 2×0.623=1.2472 \times 0.623 = 1.247 mol. At STP the molar volume is 22.4 L/mol, giving 1.247×22.4≈27.91.247 \times 22.4 \approx 27.9 L of O2. Away from STP you would use V=nRT/PV = nRT/P instead; the mole bridge is the same.

A second worked check at non-STP conditions: the same 1.247 mol at 25∘C25^\circ\text{C} (298 K) and 1.00 atm occupies V=(1.247×0.08206×298)/1.00≈30.5V = (1.247 \times 0.08206 \times 298)/1.00 \approx 30.5 L, sensibly larger than the STP volume because the gas is warmer.

Limits and the unit-discipline habit

The law's fine print matters. It assumes point particles with no attractions, so it frays at high pressure, where particle volume matters, and near condensation, where attractions matter. It also assumes equilibrium: a gas mid-explosion is not described by one PP, one VV, one TT.

Unit discipline is the practical pitfall. Temperature in kelvins, always. RR matched to pressure and volume units, always. And gauge pressures converted to absolute before use.

A worked example of the classic blunder: 0.100 mol at 2.00 atm and 300 K in liters. Correct: V=(0.100×0.08206×300)/2.00=1.23V = (0.100 \times 0.08206 \times 300)/2.00 = 1.23 L. With the wrong RR: (0.100×8.314×300)/2.00=125(0.100 \times 8.314 \times 300)/2.00 = 125 L, off by a factor of 101. The absurd answer is the tell: a tenth of a mole at 2 atm should occupy about a soda bottle, not a bathtub. When a gas-law answer looks ridiculous, check RR first.

Common mistakes

✗ R is a universal constant with one value.

R is universal but unit-dependent: 0.08206 L·atm/(mol·K) equals 8.314 J/(mol·K). The number changes with your units; the physics does not.

✗ The ideal gas law only works at STP.

It works at any temperature and pressure where the gas behaves ideally. STP is just a convenient reference point, not a requirement.

✗ Density of a gas depends on the container size.

At fixed T and P, density is fixed: d = PM/RT. A thimble and a tank of the same gas at the same conditions have identical densities.

Real-world applications

  • Computing gas density for balloon and airship design

  • Finding molar masses of unknown volatile liquids

  • Sizing industrial gas storage vessels

  • Converting between gas mass and volume in stoichiometry

Frequently asked questions

Which value of R should I use?

Match R to your pressure and volume units. Use 0.08206 L·atm/(mol·K) with atm and liters, or 8.314 J/(mol·K) with pascals and cubic meters. Mixing them is the most common ideal-gas error.

Can the ideal gas law find a molar mass?

Yes. Substitute n = m/M into PV = nRT and solve for M: M = mRT/(PV). Measure the mass, pressure, volume, and temperature of a gas sample and the molar mass follows.

Does PV = nRT work for real gases?

No. The law describes ideal gases; real gases deviate at high pressure and low temperature. It also cannot handle changing amounts mid-problem unless you track n1 and n2 separately.

Why does R have such strange units?

Because R carries the units that make both sides match: PV has units of energy, and nT has units of mol·K. The constant converts between them, which is why its value depends on your unit choices.