# The ideal gas law: PV = nRT

Canonical: https://duckyhelper.com/learn/chemistry/ideal-gas-law/
Updated: 2026-10-01

The ideal gas law, \(PV = nRT\), connects a gas's pressure (P), volume (V), amount in moles (n) and temperature (T). R is the gas constant: 0.08206 L·atm/(mol·K) when pressure is in atmospheres, or 8.314 J/(mol·K). Temperature must be in kelvins. If you know three of P, V, n and T, you can solve for the fourth.

## Key ideas

$$
PV = nRT
$$

- \(P\) is pressure, in atmospheres (atm) when you use R = 0.08206. 1 atm = 101.325 kPa = 760 mmHg.
- \(V\) is volume, in liters (L).
- \(n\) is the amount of gas, in moles (mol).
- \(R\) is the gas constant. Pick the value whose units match your pressure and volume (table below).
- \(T\) is the absolute temperature, in kelvins (K): \(T = {}^{\circ}\text{C} + 273.15\).

**Pick R to match your units**

| Pressure unit | Volume unit | R |
| --- | --- | --- |
| atm | L | 0.08206 L·atm/(mol·K) |
| kPa | L | 8.314 L·kPa/(mol·K) |
| mmHg (torr) | L | 62.36 L·mmHg/(mol·K) |
| Pa | m³ | 8.314 J/(mol·K) |

When the same gas changes conditions and the amount stays fixed, \(nR\) cancels and you get the **combined gas law**. Boyle's law (constant T), Charles's law (constant P) and Gay-Lussac's law (constant V) are all special cases of it:

$$
\frac{P_1 V_1}{T_1} = \frac{P_2 V_2}{T_2}
$$

At **STP** (0 °C = 273.15 K and 1 atm), 1 mol of an ideal gas takes up about 22.4 L. Some newer textbooks define STP as 1 bar instead, which gives 22.7 L, so check which one your class uses.

## Worked examples

**Example 1: solve for volume**

Problem: What volume does 2.00 mol of gas take up at 25.0 °C and 1.00 atm?

1. Convert the temperature to kelvins.

   $$
   T = 25.0 + 273.15 = 298.15\ \text{K}
   $$
2. Solve \(PV = nRT\) for \(V\).

   $$
   V = \frac{nRT}{P}
   $$
3. Plug in. Every unit except liters cancels.

   $$
   V = \frac{2.00\ \text{mol} \times 0.08206\ \tfrac{\text{L·atm}}{\text{mol·K}} \times 298.15\ \text{K}}{1.00\ \text{atm}} = 48.93\ \text{L}
   $$

Answer: 48.9 L

**Example 2: solve for pressure**

Problem: 0.500 mol of nitrogen is in a 10.0 L tank at 300. K. What is the pressure?

1. Solve for \(P\).

   $$
   P = \frac{nRT}{V}
   $$
2. Plug in.

   $$
   P = \frac{0.500\ \text{mol} \times 0.08206\ \tfrac{\text{L·atm}}{\text{mol·K}} \times 300.\ \text{K}}{10.0\ \text{L}} = 1.231\ \text{atm}
   $$

Answer: 1.23 atm

**Example 3: find the mass of a gas**

Problem: A 5.00 L tank holds carbon dioxide at 2.50 atm and 27.0 °C. How many grams of \(\mathrm{CO_2}\) are inside?

1. Temperature in kelvins.

   $$
   T = 27.0 + 273.15 = 300.15\ \text{K}
   $$
2. Solve for moles.

   $$
   n = \frac{PV}{RT} = \frac{2.50\ \text{atm} \times 5.00\ \text{L}}{0.08206\ \tfrac{\text{L·atm}}{\text{mol·K}} \times 300.15\ \text{K}} = 0.5075\ \text{mol}
   $$
3. Moles to grams with \(M_{\mathrm{CO_2}} = 12.01 + 2(16.00) = 44.01\) g/mol.

   $$
   0.5075\ \text{mol} \times 44.01\ \text{g/mol} = 22.34\ \text{g}
   $$

Answer: 22.3 g of \(\mathrm{CO_2}\)

**Example 4: combined gas law**

Problem: A weather balloon holds 2.50 L of helium at 1.00 atm and 20.0 °C. It rises to where the pressure is 0.800 atm and the temperature is \(-10.0\) °C. What is its new volume?

1. Convert both temperatures.

   $$
   T_1 = 20.0 + 273.15 = 293.15\ \text{K} \qquad T_2 = -10.0 + 273.15 = 263.15\ \text{K}
   $$
2. Solve the combined gas law for \(V_2\).

   $$
   V_2 = V_1 \times \frac{P_1}{P_2} \times \frac{T_2}{T_1}
   $$
3. Plug in.

   $$
   V_2 = 2.50\ \text{L} \times \frac{1.00\ \text{atm}}{0.800\ \text{atm}} \times \frac{263.15\ \text{K}}{293.15\ \text{K}} = 2.805\ \text{L}
   $$
4. Sense check: lower pressure makes it bigger, colder air makes it a little smaller. Bigger overall makes sense.

Answer: 2.81 L

## Common mistakes and how to fix them

- **Using Celsius.** At 0 °C the formula would give zero volume. Fix: always add 273.15 first.
- **Mismatched R.** Using 0.08206 with a pressure in kPa makes the answer off by a factor of about 100. Fix: match R to your pressure unit, or convert pressure to atm.
- **Using mL.** Fix: R = 0.08206 needs liters. Divide mL by 1000.
- **Using the combined gas law when the amount changes.** If gas is added or leaks out, n changes. Fix: use \(PV = nRT\) for each state instead.

**Practice problems**

1. Convert 37 °C (body temperature) to kelvins.
   A. 236 K
   B. 310 K
   C. 37 K
   D. 273 K

   Answer: 310 K. \(37 + 273.15 = 310.15\), which is 310 K to the ones place.

2. What volume does 1.00 mol of an ideal gas take up at 273.15 K and 1.00 atm?
   A. 1.00 L
   B. 8.31 L
   C. 22.4 L
   D. 24.5 L

   Answer: 22.4 L. \(V = nRT/P = 1.00 \times 0.08206 \times 273.15 \div 1.00 = 22.4\) L. 24.5 L is the volume at 25 °C.

3. 3.00 mol of gas is in a 25.0 L container at 350. K. What is the pressure in atm?

   Answer: 3.45 atm. \(P = nRT/V = 3.00 \times 0.08206 \times 350. \div 25.0 = 3.447\), so 3.45 atm.

4. A gas takes up 4.00 L at 1.00 atm. At the same temperature, the pressure is raised to 2.00 atm. What is the new volume?
   A. 8.00 L
   B. 2.00 L
   C. 4.00 L
   D. 0.500 L

   Answer: 2.00 L. With T fixed, \(P_1V_1 = P_2V_2\): \(V_2 = 1.00 \times 4.00 \div 2.00 = 2.00\) L. Double the pressure, half the volume.

5. How many moles of gas are in a 6.00 L container at 2.00 atm and 300. K?

   Answer: 0.487 mol. \(n = PV/RT = (2.00 \times 6.00) \div (0.08206 \times 300.) = 12.0 \div 24.62 = 0.487\) mol.

## Frequently asked questions

### Why does temperature have to be in kelvins?

The gas laws need a temperature scale that starts at zero energy. Kelvin does: 0 K is absolute zero. Celsius puts zero at water's freezing point, so doubling a Celsius number does not double the energy of the gas, and the math breaks.

### What makes a gas ideal?

An ideal gas is a model: its particles take up no space and do not attract each other. Real gases act almost ideal at ordinary temperatures and pressures. They drift away from the model at very high pressures or very low temperatures, where particles are crowded or slow.

### Which gas law should I use?

If the problem gives moles or grams, or asks for them, use \(PV = nRT\). If one sample of gas changes from one set of conditions to another, use the combined gas law and cross out whatever stays constant.

### How do I find molar mass with the ideal gas law?

Use \(PV = nRT\) to find moles from the measured pressure, volume and temperature. Then divide the mass of the gas sample by those moles. The result in g/mol tells you which gas it could be.

## Sources

- [OpenStax Chemistry 2e, 9.2 Relating Pressure, Volume, Amount, and Temperature: The Ideal Gas Law](https://openstax.org/books/chemistry-2e/pages/9-2-relating-pressure-volume-amount-and-temperature-the-ideal-gas-law), accessed 2026-10-01
- [NIST, molar gas constant R (CODATA)](https://physics.nist.gov/cgi-bin/cuu/Value?r), accessed 2026-10-01

## Related

- [The mole and molar mass](https://duckyhelper.com/learn/chemistry/mole-and-molar-mass/)
- [Stoichiometry: how much reacts and how much forms](https://duckyhelper.com/learn/chemistry/stoichiometry/)
- [Unit conversion and significant figures](https://duckyhelper.com/learn/physics/unit-conversion-and-significant-figures/)
- [Chemistry study guides](https://duckyhelper.com/learn/chemistry/)

## Try asking Ducky

- "Check my units on problem 5. Did I pick the right R for kilopascals?"
- "Which gas law should I use for this question on my worksheet, and why?"
- "Quiz me on Boyle's, Charles's and the combined gas law, one question at a time."

## Get DuckyHelper

Free to start. The web app works in any browser, Chromebooks included; the Mac app can also draw on your real screen. [Try it free in your browser](https://app.duckyhelper.com/?utm_source=duckyhelper.com&utm_medium=learn) or [Get the Mac app](https://duckyhelper.com/download/)
