Pressure and Temperature Equation: The Ideal Gas Law
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator applies the ideal gas law to find the missing value when you know the other three: pressure, volume, temperature, or amount of gas. You enter three of the four variables (with units), and it returns the fourth, along with the number of moles if that is what you solved for. The relationship is PV = nRT, the single most useful equation in basic chemistry and physics.
Formula
The ideal gas law is written as:
PV = nRT
Where:
- P = pressure of the gas (in atmospheres, atm; or Pa, kPa, mmHg, etc.)
- V = volume of the gas (in liters, L; or m³, cm³, etc.)
- n = amount of gas (in moles, mol)
- R = the ideal gas constant (value depends on the units you choose)
- T = absolute temperature (in kelvin, K; never in °C or °F directly)
The most common value of R is 0.082057 L·atm·mol⁻¹·K⁻¹, which works when pressure is in atm, volume in liters, and temperature in kelvin. If you use SI units (Pa for pressure, m³ for volume), then R = 8.314 J·mol⁻¹·K⁻¹. Always match R to your units—mixing them is the #1 source of error.
Worked Example
Using the calculator defaults: P = 1 atm, V = 22.4 L, T = 273.15 K, and n is unknown.
Rearrange the ideal gas law to solve for n:
n = PV / (RT)
Plug in the numbers:
n = (1 atm × 22.4 L) / (0.082057 L·atm·mol⁻¹·K⁻¹ × 273.15 K)
First, the denominator: 0.082057 × 273.15 = 22.414 (approximately). Then divide: 22.4 / 22.414 = 0.9994 mol.
The calculator rounds to 3 decimals and shows 0.999 mol. This is the classic molar volume result: one mole of an ideal gas occupies 22.4 L at STP (0 °C, 1 atm).
When to Use This Equation
The ideal gas law applies to gases at moderate pressures (near atmospheric) and temperatures well above their boiling point. It is used in countless real situations:
- Calculating the volume of gas produced in a chemical reaction (e.g., in a lab).
- Finding the pressure inside a scuba tank or a car tire when temperature changes.
- Estimating how many moles of air are in a room to size ventilation.
- Converting between mass and volume of a gas for industrial processes.
It is also the starting point for more advanced equations (van der Waals, virial) that correct for real-gas behavior at high pressure or low temperature.
How to Read the Result
The first output (Amount, mol) is the headline answer. If you instead enter n, P, and T, the calculator will give you volume; if you enter n, V, and T, it gives pressure. The result is only as good as your inputs—check that the temperature is in kelvin (add 273.15 to Celsius) and that pressure and volume units match the R constant you are using.
A common mistake is using Celsius directly. For example, 25 °C must become 298.15 K. Using 25 K would give a wildly wrong answer. Also, be careful with pressure: 1 atm = 101.325 kPa = 760 mmHg = 14.696 psi. If you enter pressure in psi but use R in atm, you must convert first.
Limits of the Ideal Gas Law
The ideal gas law assumes gas molecules have negligible volume and no intermolecular forces. This holds well for most gases at room temperature and pressures up to a few atmospheres. At high pressure (e.g., 100+ atm) or near the condensation point, real gases deviate. For those cases, use the van der Waals equation:
(P + a(n/V)²)(V – nb) = nRT
where a and b are substance-specific constants. For most everyday calculations, however, the ideal gas law is accurate to within a few percent.
Common Problems and Misconceptions
- Mixing units: Using kPa with R in atm gives answers off by ~101. Always convert to match R.
- Forgetting to convert °C to K: This is the most frequent error. Always add 273.15.
- Confusing STP and NTP: STP is 0 °C (273.15 K) and 1 atm; NTP is 20 °C (293.15 K) and 1 atm. The molar volume differs (22.4 L vs 24.0 L).
- Assuming ideal behavior at extreme conditions: At high pressure or low temperature, the law fails. Use a real-gas equation or compressibility factor.
- Using the wrong R value: R = 0.0821 (L·atm), 8.314 (J), 62.36 (L·mmHg), etc. Pick the one that matches your units.
Frequently Asked Questions
What is the relationship between pressure and temperature?
At constant volume and amount of gas, pressure and temperature are directly proportional (Gay-Lussac’s law). If you double the kelvin temperature, pressure doubles. This is why aerosol cans warn against heating—pressure can build up dangerously.
Can I use Celsius in the ideal gas law?
No. The equation requires absolute temperature in kelvin because it is derived from kinetic theory where temperature is proportional to average kinetic energy. Celsius is an offset scale, so using it gives incorrect results. Convert by adding 273.15.
What is the value of R in different units?
R = 0.082057 L·atm·mol⁻¹·K⁻¹, 8.314 J·mol⁻¹·K⁻¹, 62.364 L·mmHg·mol⁻¹·K⁻¹, and 1.987 cal·mol⁻¹·K⁻¹. Use the one that matches your pressure and volume units.
Why does the ideal gas law fail at high pressure?
At high pressure, gas molecules are close together, so their own volume becomes significant and intermolecular attractions pull them closer. The ideal law ignores both. The van der Waals equation adds correction terms to account for these effects.
What is the difference between ideal gas and real gas?
An ideal gas is a theoretical model with point particles and no interactions. Real gases deviate at high pressure and low temperature. For most engineering and lab work at moderate conditions, the ideal gas law is accurate enough.
Related
Formula used
in P | Pressure | atm | 1 | 0 in V | Volume | L | 22.4 | 0 in T | Temperature | K | 273.15 | 0 in n | Amount | mol | 1 | 0 out n | Amount (mol) | mol | (P * V) / (0.082057 * T) | 3 out P | Pressure (atm) | atm | (n * 0.082057 * T) / V | 3
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.