HomeMath › Ideal Gas Law Calculator

Ideal Gas Law Calculator

Solve the ideal gas law PV = nRT for whichever variable you are missing. Pick what to solve for, then enter pressure (atm, kPa, or Pa), volume (L, mL, or m³), amount (moles), and temperature (K, °C, or °F).

Example: with Solve for Amount (moles, n) · Pressure 1 · Pressure unit atm · Volume 22.414 · Volume unit L (liters) → Result: 1.0000 mol.

  • In other units6.022e+23 molecules
  • Sense of scaleAt STP (0 °C, 1 atm) one mole fills 22.4 L — about a basketball worth of gas

Computed by the calculator below using its default values. Change any input to see your own numbers.

Result
In other units
Sense of scale

PV = nRT with R = 8.314462618 J/(mol·K). Enter three of the four quantities and the fourth follows. Everything is converted to SI base units before solving, so unit choices cannot trip the math.

What the ideal gas law ties together

The ideal gas law links four properties of a gas sample: its pressure P, its volume V, the amount of gas n in moles, and its absolute temperature T. The constant R stitches the units together. Fix any three and the fourth is determined, because a gas that is squeezed, warmed, or added to responds in a predictable way.

The model treats gas particles as tiny, non-interacting points in constant motion. That picture is remarkably accurate for everyday air, helium, and nitrogen at ordinary temperatures and pressures, which is why the same equation covers scuba tanks, weather balloons, and car airbags.

Units are where people slip

The equation only behaves if the units are consistent. This calculator converts pressure to pascals, volume to cubic meters, and temperature to kelvin before touching R, then reports the answer back in familiar units. Temperature especially must be absolute — kelvin, not Celsius or Fahrenheit — or the ratio is meaningless.

Real gases drift from ideal behavior when they are cold enough or compressed enough for particle size and attraction to matter. Near those conditions, engineers reach for corrections like the van der Waals equation; for typical classroom and lab work, the ideal law is close enough.

How it’s calculated

PV = nRT with the gas constant R = 8.314462618 J/(mol·K) (CODATA). Inputs convert to SI first: 1 atm = 101,325 Pa, 1 kPa = 1,000 Pa; 1 L = 0.001 m³, 1 mL = 1e-6 m³; K = °C + 273.15, K = (°F − 32)·5/9 + 273.15. The chosen unknown is solved as n = PV/RT, P = nRT/V, V = nRT/P, or T = PV/nR.

Assumes ideal-gas behavior. Real gases deviate at high pressure or low temperature, where molecular volume and intermolecular forces become significant.

The gas constant R in common units

UnitsValue of R
SI8.314462618 J/(mol·K)
Liter-atmosphere0.0820573 L·atm/(mol·K)
Liter-kilopascal8.314462618 L·kPa/(mol·K)
Calorie1.987204 cal/(mol·K)

Source: CODATA 2018 value R = 8.314462618 J/(mol·K); other forms derived by unit conversion.

Common mistakes

  • Using Celsius or Fahrenheit instead of kelvin — temperature in the gas law must be absolute.
  • Mismatching R and the units: liter-atmosphere problems need R = 0.08206, not 8.314.
  • Forgetting to convert gauge pressure to absolute pressure before solving.
  • Applying the ideal law to a gas near condensation, where real-gas deviations are large.

Frequently asked questions

What is the ideal gas law formula?

PV = nRT: pressure times volume equals moles times the gas constant times absolute temperature. With SI units R is 8.314462618 J/(mol·K), and any one variable can be found from the other three.

What value of R should I use?

Use 8.314 J/(mol·K) when pressure is in pascals and volume in cubic meters, or 0.08206 L·atm/(mol·K) when pressure is in atmospheres and volume in liters. This tool handles the conversion for you.

Why must temperature be in kelvin?

The law relies on the ratio of absolute temperatures. Celsius and Fahrenheit have arbitrary zero points, so using them makes the proportionality between temperature and pressure or volume break down.

What is STP and why is one mole 22.4 liters?

At standard temperature and pressure (0 °C and 1 atm), one mole of an ideal gas occupies 22.4 liters. Plugging those values into PV = nRT gives that molar volume directly.

When does the ideal gas law stop working?

It loses accuracy at high pressure or low temperature, where gas particles are close enough that their size and mutual attraction matter. There, real-gas equations give better answers.