ThisCalculator

Everyday

Temp and Pressure Formula: Ideal Gas Law

Updated · Standard formula, shown below

Missing value 0.00
Pressure
1 atm
You entered
Volume
22.4 L
You entered
Amount
1 mol
You entered
Temperature
273.15 K
You entered

This calculator applies the ideal gas law to find the missing value when you enter the other three: pressure, volume, temperature, or amount of gas. You enter any three of these four quantities, and the calculator returns the fourth, with units you choose. The relationship is PV = nRT, where P is pressure, V is volume, n is the number of moles, and T is absolute temperature.

Formula

The ideal gas law is written as:

PV = nRT

  • P = pressure of the gas (atmospheres, atm; pascals, Pa; or other units)
  • V = volume of the gas (liters, L; cubic meters, m³)
  • n = amount of gas (moles, mol)
  • R = ideal gas constant (0.0821 L·atm·mol⁻¹·K⁻¹ when using atm and liters)
  • T = absolute temperature (kelvin, K)

To solve for any single variable, rearrange the equation:

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

Note that temperature must always be in kelvin. Celsius or Fahrenheit values must be converted first (K = °C + 273.15).

Worked Example

Using the default values from the calculator: P = 1 atm, V = 22.4 L, n = 1 mol, T = 273.15 K. The calculator is set to find the missing value, which in this case is none—all four are given. But if you wanted to find temperature, you would plug in the others:

  1. Start with T = PV / (nR)
  2. T = (1 atm × 22.4 L) / (1 mol × 0.0821 L·atm·mol⁻¹·K⁻¹)
  3. T = 22.4 / 0.0821 = 272.84 K

The slight difference from 273.15 K is due to rounding the gas constant. The calculator uses the same formula and gives 272.84 K when you set inputs to 1 atm, 22.4 L, 1 mol, and ask for T.

Why the Ideal Gas Law Works

The ideal gas law combines several simpler gas laws discovered between the 17th and 19th centuries. Boyle’s law states that at constant temperature, pressure and volume are inversely proportional. Charles’s law says that at constant pressure, volume and temperature are directly proportional. Avogadro’s law adds that equal volumes of gases at the same temperature and pressure contain the same number of molecules. The ideal gas law merges these into one equation, with the gas constant R tying the units together.

The law assumes gas molecules have negligible volume and no intermolecular forces. This works well for most gases at low pressure and high temperature. At high pressure or low temperature, real gases deviate, and more complex equations like the van der Waals equation are needed.

How to Choose the Right Units

The gas constant R changes value depending on the units of pressure and volume. The most common set is:

  • R = 0.0821 L·atm·mol⁻¹·K⁻¹ (for liters and atmospheres)
  • R = 8.314 J·mol⁻¹·K⁻¹ (for pascals and cubic meters, where pressure is in Pa and volume in m³)
  • R = 62.36 L·mmHg·mol⁻¹·K⁻¹ (for liters and millimeters of mercury)

Always match the units of P and V to the R you use. If you mix atmospheres with pascals, the answer will be off by a factor of 101,325. Convert everything to the same system first.

Common Mistakes and Misconceptions

One frequent error is using Celsius instead of kelvin. Temperature in the ideal gas law must be absolute, because the law is based on kinetic energy, which is proportional to absolute temperature. Adding 273.15 to Celsius is essential.

Another mistake is forgetting that pressure must be absolute, not gauge pressure. Gauge pressure is what a tire gauge reads; it excludes atmospheric pressure. To use the ideal gas law, add atmospheric pressure (about 1 atm or 101.325 kPa) to the gauge reading.

A common misconception is that the ideal gas law works for all gases under all conditions. In reality, it is an approximation. For example, at 100 atm, real gases deviate by a few percent. For precise work, use real gas equations or compressibility factors.

Limits of the Formula

The ideal gas law fails when gas molecules are close together or moving slowly. This happens at high pressure (molecules occupy significant volume) and low temperature (intermolecular forces become significant). The van der Waals equation corrects for these by adding terms for molecular volume and attraction:

(P + a(n/V)²)(V – nb) = nRT

where a and b are substance-specific constants. For most engineering and chemistry problems at room temperature and atmospheric pressure, the ideal gas law is accurate to within a few percent.

Also, the law assumes a closed system with no chemical reactions. If a gas reacts or changes composition, the number of moles n changes, and the simple formula no longer applies.

Real-World Applications

The ideal gas law is used everywhere from weather balloons to scuba diving. Meteorologists use it to estimate air density and pressure at altitude. Scuba divers use it to calculate how much air they breathe at depth, where pressure increases by about 1 atm every 10 meters of seawater. In industry, it is used to size gas cylinders, design compressors, and calculate the amount of gas produced in chemical reactions.

For example, if you have a 10 L cylinder of nitrogen at 150 atm and 25°C, you can find the number of moles: n = PV/(RT) = (150 atm × 10 L) / (0.0821 × 298 K) ≈ 61.3 mol. That tells you how many grams of gas you have (multiply by molar mass, 28 g/mol, to get about 1.72 kg).

Frequently Asked Questions

What is the formula for pressure and temperature?

The direct relationship between pressure and temperature at constant volume and amount is given by Gay-Lussac’s law: P₁/T₁ = P₂/T₂, where temperatures are in kelvin. This is a special case of the ideal gas law when V and n are constant.

How do I convert Celsius to kelvin for this formula?

Add 273.15 to the Celsius value. For example, 25°C becomes 298.15 K. Never use Celsius directly in the ideal gas law because the law is based on absolute temperature.

What is the value of R in the ideal gas law?

It depends on units. The most common is 0.0821 L·atm·mol⁻¹·K⁻¹. In SI units, it is 8.314 J·mol⁻¹·K⁻¹ (which equals 8.314 Pa·m³·mol⁻¹·K⁻¹). Always match R to your pressure and volume units.

Can I use this formula for any gas?

Yes, for ideal gases. Real gases like helium, hydrogen, and air follow it closely at normal conditions. Heavy or polar gases like water vapor or carbon dioxide deviate more, especially at high pressure. For those, use a real gas equation.

Why does the calculator ask for only three inputs?

Because the ideal gas law has four variables, and you need to know three to find the fourth. The calculator lets you leave any one field empty (or set it to zero) and computes it from the others. In the default view, all four are filled, so it shows the result of the formula as a check.

What if I don’t know the number of moles?

You can calculate moles from mass: n = mass / molar mass. For example, 44 g of CO₂ (molar mass 44 g/mol) is 1 mole. Then use the ideal gas law as usual.

Related

Formula used
in p | Pressure | atm | 1 | 0
in v | Volume | L | 22.4 | 0
in n | Amount | mol | 1 | 0
in t | Temperature | K | 273.15 | 0
out result | Missing value | - | 0 | 2

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.