How the ideal gas law works
The ideal gas law ties together the four things that describe a sample of gas: its pressure, its volume, how many moles of gas there are, and its absolute temperature. If you know any three, you can find the fourth. It combines Boyle's law (P and V are inversely related), Charles's law (V rises with T) and Avogadro's law (V rises with n) into one equation.
The only trick is units. R has to match the units of P and V, and T must always be in kelvin. This calculator converts every input to SI units (pascals, cubic meters, kelvin) behind the scenes, so you can enter mmHg, mL and °F directly.
The formula
P = nRT ÷ V V = nRT ÷ P n = PV ÷ RT T = PV ÷ nR
R = 8.314462618 J/(mol·K) = 0.082057366 L·atm/(mol·K)
K = °C + 273.15 1 atm = 101.325 kPa = 760 mmHg = 1.01325 bar = 14.696 psi
Example: one mole of gas at 0 °C and 1 atm
| Step | Result |
|---|---|
| Convert temperature: 0 °C + 273.15 | 273.15 K |
| V = nRT ÷ P = 1 × 0.082057 × 273.15 ÷ 1 | 22.414 L |
| Same in SI: 1 × 8.3145 × 273.15 ÷ 101,325 Pa | 0.022414 m³ |
That 22.414 L is the famous molar volume of a gas at STP (0 °C, 1 atm).
Gas constant R in different units
| Value of R | Units | Use when P and V are in |
|---|---|---|
| 8.314462618 | J/(mol·K) or Pa·m³/(mol·K) | Pa and m³ |
| 8.314462618 | L·kPa/(mol·K) | kPa and L |
| 0.082057366 | L·atm/(mol·K) | atm and L |
| 62.363593 | L·mmHg/(mol·K) | mmHg and L |
| 0.08314462618 | L·bar/(mol·K) | bar and L |
Common mistakes
- Using Celsius. Always convert to kelvin first. Plugging in 25 instead of 298.15 makes the answer about 12 times too small.
- Mismatched R. Using 8.314 with atm and liters gives an answer off by a factor of about 101. Match R to your units or convert P and V.
- Forgetting mL to L. 500 mL is 0.500 L.
- Using grams instead of moles. If you're given a mass, divide by molar mass to get n first.
- Expecting exact results for real gases. At high pressure or near condensation, real gases deviate from PV = nRT.
Frequently asked questions
What is the ideal gas law?
The ideal gas law, PV = nRT, relates the pressure P, volume V, amount in moles n, and absolute temperature T of a gas. R is the gas constant. It describes most gases well at ordinary temperatures and pressures.
Which value of R should I use?
It depends on your units. With pressure in atm and volume in liters, use R = 0.082057 L·atm/(mol·K). With pressure in pascals and volume in cubic meters, use R = 8.314 J/(mol·K). With kPa and liters, R is also 8.314 L·kPa/(mol·K). This calculator converts everything to SI units for you.
Why must temperature be in kelvin?
The ideal gas law needs absolute temperature, which starts at zero at absolute zero. At 0 °C a gas still has plenty of thermal energy, so using Celsius would give nonsense such as zero or negative volume. Convert with K = °C + 273.15.
What is the volume of one mole of gas at STP?
At 0 °C and 1 atm, one mole of an ideal gas occupies 22.414 L. IUPAC's current STP is 0 °C and 1 bar, where the molar volume is 22.711 L. At 25 °C and 1 atm it's about 24.465 L.
When does the ideal gas law stop working well?
At high pressures and low temperatures, especially near the point where the gas would condense. Real gas molecules take up space and attract each other, which the ideal gas law ignores. The van der Waals equation corrects for both effects.
Rates and figures last checked October 2026.
This calculator gives estimates for planning. Check current rates and product labels before you buy, list or file.