Skip to main content

How to Solve Ideal Gas Law Problems

One equation, four variables, one constant that has three faces

PV = nRT is the most useful equation in introductory gas chemistry, and it’s also where students lose the most points to silly errors. The physics is clean — the gas law assumes negligible particle volume and no intermolecular attractions, which holds well for most gases at room temperature and atmospheric pressure. The arithmetic is also clean. What gets people is the bookkeeping: temperature must be in Kelvin (no exceptions), and the R you pick must match your pressure and volume units. Slip on either and your answer is off by a factor of 273 or 101,325.

Get those two right, and the rest is algebra: rearrange to isolate the unknown, plug in, and check the result against the 22.4 L/mol benchmark at STP.

Pick your R

The gas constant R has the same physics in every form, just different numerical values for different unit conventions:

  • R = 0.08206 L·atm / (mol·K) — pressure in atm, volume in liters. The default for general chemistry.
  • R = 8.314 J / (mol·K) — full SI: pressure in Pa, volume in m³, energy in J. Use for thermodynamics.
  • R = 62.36 L·mmHg / (mol·K) — pressure in mmHg or torr, volume in liters.
  • R = 8.314 L·kPa / (mol·K) — pressure in kPa, volume in liters.

Look at your problem’s units and pick the R that matches. Mixing them is the error you want to avoid.

The procedure

Step 1: List what’s given

Three of P, V, n, T are known. One is your unknown. If the problem gives you grams instead of moles, convert: n = m / M.

Step 2: Force the temperature into Kelvin

T(K) = T(°C) + 273.15. Always. Celsius into PV = nRT is wrong even if “it almost works” at room temperature.

Step 3: Match R to your units

If pressure is in kPa and volume in liters, you want R = 8.314 L·kPa / (mol·K) — or convert pressure to atm and use 0.08206. Either route works; the disaster is using 0.08206 with kPa.

Step 4: Rearrange and solve

  • P = nRT / V
  • V = nRT / P
  • n = PV / RT
  • T = PV / nR

Step 5: Sanity-check at STP

One mole of an ideal gas occupies 22.4 L at 0 °C and 1 atm. If your answer for V or n is wildly off from what STP would predict, recheck your units.

Worked examples

Example 1: Volume from P, n, T

What volume does 2.50 mol of N₂ occupy at 1.00 atm and 25.0 °C?

T = 298.15 K. V = nRT / P = (2.50)(0.08206)(298.15) / 1.00 = 61.2 L

Sanity check: 2.50 mol at STP would be 56.0 L. We’re slightly above ambient, so 61.2 L is reasonable.

Example 2: Pressure in a closed container

A 10.0 L container holds 0.500 mol of O₂ at 37.0 °C. Pressure?

T = 310.15 K. P = nRT / V = (0.500)(0.08206)(310.15) / 10.0 = 1.27 atm

Example 3: Molar mass from P, V, T, and mass

A 5.00 L flask at 27.0 °C and 740 mmHg holds 6.39 g of an unknown gas. Molar mass?

T = 300.15 K. Use R = 62.36 to match mmHg.

n = PV / RT = (740)(5.00) / (62.36)(300.15) = 0.1977 mol

Molar mass = 6.39 g / 0.1977 mol = 32.3 g/mol

That’s O₂ within rounding error. The technique generalizes to any gas with measurable density.

Example 4: Temperature

At what temperature does 1.20 mol of He exert 3.00 atm in a 15.0 L container?

T = PV / nR = (3.00)(15.0) / (1.20)(0.08206) = 457 K (184 °C)

Example 5: STP check

What volume does 0.750 mol of CO₂ occupy at STP (0 °C, 1.00 atm)?

T = 273.15 K. V = (0.750)(0.08206)(273.15) / 1.00 = 16.8 L

Quick check: 0.750 × 22.4 = 16.8 L. Exact match by construction.

Where calculations go wrong

Celsius in the equation. Catastrophic at low temperatures (you’ll get nonsense or division by zero at 0 °C) and just plain wrong at any other temperature. T(K) = T(°C) + 273.15.

Mismatched R. kPa with R = 0.08206 will give you an answer about 100× too small. Always cross-reference R against your pressure and volume units.

Grams instead of moles. PV = nRT, not PV = mRT. Convert mass to moles using molar mass before plugging in.

Significant figures. R = 0.08206 has four sig figs. Your answer should match the least precise input — usually the pressure or volume measurement.

Stretching the ideal-gas approximation too far. At very high pressure or very low temperature, real gases deviate from ideal behavior. For those regimes, switch to the van der Waals equation or another real-gas model.

When to reach for a different gas law

  • Single sample, three of four variables known: PV = nRT.
  • Same gas, two different states, fixed amount: combined gas law, P₁V₁/T₁ = P₂V₂/T₂.
  • Mixture of gases: Dalton’s law of partial pressures, P_total = ΣP_i.
  • Effusion or diffusion rates: Graham’s law.

Use our Ideal Gas Law Calculator to solve for any variable, with automatic unit handling and the steps shown.

Ready to try it yourself?

Open Calculator

Related Guides