How to Solve Ideal Gas Law Problems Using PV = nRT

Solving an ideal gas law problem comes down to one equation: PV = nRT. You plug in the values you know, make sure your units match, and solve for the missing variable. The process is straightforward once you understand what each variable represents and how to keep your units consistent.

The Equation and Its Variables

PV = nRT connects four properties of a gas:

  • P = pressure of the gas
  • V = volume the gas occupies
  • n = amount of gas in moles
  • R = the universal gas constant
  • T = temperature in Kelvin

R is a fixed constant, so in any problem you’ll be given three of the four remaining variables and asked to find the fourth. The value of R you use depends on your pressure and volume units. The most common value in chemistry courses is 0.0821 L·atm/(mol·K), which works when pressure is in atmospheres and volume is in liters. If your pressure is in kilopascals, use R = 8.314 L·kPa/(mol·K). If pressure is in pascals and volume in cubic meters, R = 8.314 J/(mol·K).

Step-by-Step Problem Solving

Every ideal gas law problem follows the same sequence:

1. Identify the unknown. Read the problem and figure out which variable you’re solving for. Write down every value you’re given.

2. Convert your units. This is where most mistakes happen. Temperature must be in Kelvin. If you’re given Celsius, add 273.15. A temperature of 25°C becomes 298.15 K. Pressure must match the units in your chosen R value. Volume must also match. If R uses liters and atmospheres, your volume needs to be in liters and your pressure in atmospheres.

3. Rearrange the equation. Solve algebraically for the unknown before plugging in numbers:

  • For pressure: P = nRT / V
  • For volume: V = nRT / P
  • For moles: n = PV / RT
  • For temperature: T = PV / nR

4. Plug in and calculate. Substitute your values, do the math, and check that your answer has the right units.

A Worked Example

Suppose you have 2.0 moles of oxygen gas in a 10.0 L container at 27°C, and you need to find the pressure.

First, convert the temperature: 27 + 273 = 300 K. You have n = 2.0 mol, V = 10.0 L, T = 300 K, and R = 0.0821 L·atm/(mol·K).

Rearrange for pressure: P = nRT / V. Now plug in: P = (2.0 × 0.0821 × 300) / 10.0 = 49.26 / 10.0 = 4.93 atm. The gas exerts a pressure of about 4.9 atmospheres.

Common Unit Conversions

Problems often give you values in units that don’t match your gas constant. Here are the conversions you’ll use most:

For pressure: 1 atm = 760 mmHg = 101.325 kPa = 1.01325 bar. If a problem gives pressure as 380 mmHg, divide by 760 to get 0.500 atm.

For temperature: Kelvin = Celsius + 273.15. You must use Kelvin (or Rankine, though that’s rare) because the ideal gas law breaks down mathematically at 0°C if you use Celsius directly. At 0°C, Kelvin gives you 273.15, keeping the equation valid. At negative Celsius values, Kelvin stays positive, which reflects the physical reality that gas molecules still have energy.

For volume: 1 L = 1000 mL = 0.001 m³. If volume is given in milliliters, divide by 1000 to convert to liters.

Using Molar Mass and Density

Some problems give you a mass of gas instead of moles. To handle this, remember that moles equal mass divided by molar mass: n = m / M. Substituting into PV = nRT gives PV = (m/M)RT, which you can rearrange depending on what you need.

This version is especially useful for finding the molar mass of an unknown gas. If you measure a gas’s density at a known temperature and pressure, the molar mass is: M = dRT / P, where d is density in grams per liter. For example, if an unknown gas has a density of 1.96 g/L at 1.00 atm and 273 K, its molar mass is (1.96 × 0.0821 × 273) / 1.00 = 43.9 g/mol, which points to carbon dioxide (44.0 g/mol).

You can also rearrange the equation to find gas density directly: d = MP / RT. This tells you how pressure and temperature affect how dense a gas is, which makes intuitive sense. Higher pressure squeezes more gas into the same space, raising density. Higher temperature makes the gas expand, lowering density.

Standard Temperature and Pressure

Many problems reference “STP” without giving you explicit temperature and pressure values. The IUPAC definition of STP is 273.15 K (0°C) and 100 kPa (about 0.987 atm). At these conditions, one mole of an ideal gas occupies about 22.7 L.

In many chemistry courses and on the AP Chemistry exam, STP is still defined as 273.15 K and 1.0 atm, giving a molar volume of 22.4 L. Check which definition your course uses. The difference is small but can cost you points on an exam if the question expects a specific value.

Knowing the molar volume at STP is a useful shortcut. If a problem asks for the volume of 3.0 moles of gas at STP, you can skip the full calculation: 3.0 × 22.4 = 67.2 L.

Mistakes That Trip People Up

The single most common error is forgetting to convert Celsius to Kelvin. Using 25 instead of 298 gives an answer that’s off by more than a factor of ten. Build the habit of converting temperature first, before you do anything else.

The second most common error is mismatched units. If your pressure is in kPa but you’re using R = 0.0821 L·atm/(mol·K), your answer will be wrong. Before calculating, check that every unit in your values matches every unit in R. If they don’t, either convert your values or pick a different R.

A subtler mistake is applying the ideal gas law to conditions where it doesn’t work well. The equation assumes gas molecules don’t attract each other and take up no space. Real gases behave this way at moderate temperatures and low pressures, but the assumption breaks down at very high pressures (where molecules are forced close together) and very low temperatures (where molecules slow down enough for attractive forces to matter). For most textbook problems and everyday conditions, the ideal gas law is accurate enough.