ideal gas calculator

Ideal Gas Law Calculator (PV = nRT)

Choose one variable to calculate, then enter the other three values. This calculator uses R = 0.082057 L·atm/(mol·K), so use units of atm, liters, moles, and kelvin.

Rearranged forms used:
P = nRT / V, V = nRT / P, n = PV / RT, T = PV / nR
Temperature must be in Kelvin and greater than 0.

The ideal gas law is one of the most useful equations in chemistry, physics, engineering, and even practical lab work. If you've ever needed to convert between pressure, volume, temperature, and amount of gas, this is the equation you use first.

What Is the Ideal Gas Law?

The ideal gas law connects four variables:

PV = nRT

  • P = pressure
  • V = volume
  • n = number of moles of gas
  • R = gas constant
  • T = absolute temperature (Kelvin)

In plain language: if you know three of these variables, you can solve for the fourth. That is exactly what the calculator above does.

How to Use This Ideal Gas Calculator

  1. Select which variable you want to solve for: pressure, volume, moles, or temperature.
  2. Enter the other three values in the required units.
  3. Click Calculate to get the result instantly.
  4. Use Reset to clear everything and start over.

This tool is intentionally unit-specific (atm, L, mol, K) so you can avoid gas-constant mismatch errors.

Units Used in This Tool

  • Pressure: atm
  • Volume: L
  • Amount: mol
  • Temperature: K
  • Gas constant: R = 0.082057 L·atm/(mol·K)

If your data starts in °C, convert first: K = °C + 273.15.

Worked Examples

Example 1: Solve for Pressure

Given: n = 1.50 mol, T = 300 K, V = 10.0 L.

Use: P = nRT / V

P = (1.50 × 0.082057 × 300) / 10.0 = 3.69 atm

Example 2: Solve for Temperature

Given: P = 2.00 atm, V = 5.00 L, n = 0.500 mol.

Use: T = PV / (nR)

T = (2.00 × 5.00) / (0.500 × 0.082057) ≈ 243.7 K

Common Mistakes to Avoid

  • Using Celsius directly: The ideal gas law needs Kelvin.
  • Mixing units: If R is in L·atm/(mol·K), pressure must be atm and volume must be liters.
  • Typing 0 or negative values: Pressure, volume, and moles should be positive in normal ideal-gas contexts; Kelvin must be greater than zero.
  • Rounding too early: Keep extra digits during intermediate steps.

When the Ideal Gas Law Is a Good Approximation

The ideal gas equation works best when gases are at relatively low pressure and moderate-to-high temperature, where molecules are far apart and interactions are weak. It becomes less accurate at:

  • Very high pressures
  • Very low temperatures
  • Conditions near condensation

In those cases, real-gas equations such as van der Waals are more appropriate.

Quick FAQ

Can I use this for any gas?

Yes, as an approximation. The equation is universal for ideal behavior regardless of gas identity.

What if my pressure is in kPa?

Convert to atm before entering the value (1 atm = 101.325 kPa), or use a different gas constant that matches your units.

Why does temperature have to be Kelvin?

Kelvin is an absolute scale tied to molecular kinetic energy. Celsius and Fahrenheit are offset scales and cannot be used directly in PV = nRT.

Bottom Line

If you remember one formula from gas laws, make it PV = nRT. With consistent units and careful temperature conversion, it gives fast and reliable estimates for pressure, volume, moles, and temperature. Use the calculator above whenever you want a quick, accurate result without doing algebra by hand.

🔗 Related Calculators