Chemistry calculator

Ideal Gas Law Calculator

The ideal gas law is PV = nRT, and this ideal gas law calculator solves for whichever value you're missing the moment you fill in the other three. Pick the unknown, type pressure, volume, moles, or temperature, and choose your units, since it handles atm, kPa, Pa, and mmHg for pressure and K, Celsius, or Fahrenheit for temperature. You'll see the answer with the exact formula, plus a live gas container that fills with more particles as you raise the number of moles.

  • Solve for P, V, n, or T
  • atm, kPa, Pa, mmHg
  • K, °C, or °F
  • Live gas view
  • Formula shown

Last updated June 18, 2026 Method: PV = nRT Reviewed by the Calcowa chemistry team

Solve for
Gas container particles scale with moles
Volume
22.414 L
Pressure
1 atm
Moles
1 mol
Temperature
273.15 K
Formula used

V = nRT / P = (1 × 0.082057 × 273.15) / 1 = 22.414 L

The formula

What is the ideal gas law?

The ideal gas law is PV = nRT, the single equation that ties together a gas's pressure, volume, amount, and temperature. P is pressure, V is volume, n is the number of moles, R is the gas constant, and T is the absolute temperature in kelvin. For 1 mole at 0°C and 1 atm, the volume works out to 22.414 liters, the famous molar volume at STP.

It's really three older laws rolled into one. Boyle's law says pressure and volume trade off, Charles's law says volume rises with temperature, and Avogadro's law says volume rises with the amount of gas. Put them together with the constant R and you've got the whole picture in one line, which is why PV = nRT shows up everywhere from balloons to scuba tanks.

PV = nRT
n moles of gas
Gas in a fixed container
Step by step

How do you solve PV = nRT?

Decide which value you're after, then rearrange the equation and plug in. Here's the full sequence:

  1. 1

    Pick the unknownDecide whether you need pressure, volume, moles, or temperature.

  2. 2

    Convert the temperatureMake sure T is in kelvin. Add 273.15 to a Celsius reading.

  3. 3

    Match the gas constant to your unitsUse R = 0.082057 for atm and liters, or R = 8.314 for pascals and cubic meters.

  4. 4

    Rearrange and substituteFor volume, V = nRT/P. For moles, n = PV/RT, and so on.

  5. 5

    Solve and check the unitsWork out the value and confirm the units line up with what you expected.

Worked example

An ideal gas law example, step by step

Say you've got 2 moles of gas at 300 K under 1.5 atm of pressure, and you want the volume. Use V = nRT/P, so multiply 2 by R (0.082057) by 300, then divide by 1.5.

Result

V = (2 × 0.082057 × 300) / 1.5 = 32.82 L

that's about 32,820 mL, or 0.0328 m³

Type those numbers into the calculator above, leave it on the volume mode, and you'll get the same answer without rearranging anything yourself.

The constant R

What is the gas constant R?

The gas constant R ties the units together, and its number depends on which units you use. In chemistry it's usually 0.082057 L·atm per mol·K, because pressures come in atmospheres and volumes in liters. In physics it's the SI value 8.314 J per mol·K, with pressure in pascals and volume in cubic meters. They describe the same constant, just measured in different unit systems.

The trick that trips students up is mixing units, like using atm for pressure but the SI value of R. This calculator avoids that by picking the matching R for whatever units you choose, so you can't accidentally pair the wrong ones. If you need the underlying amounts, the Moles Calculator turns grams into moles for the n value.

Reference

Gas constant values and STP

Here are the common forms of R and the molar volume you'll reach for most often. Match the R value to your pressure and volume units, keep temperature in kelvin, and the math lines up every time.

ValueUse withGood to know
R = 0.082057 L·atm / (mol·K) Pressure in atm, volume in liters The common chemistry value
R = 8.314 J / (mol·K) SI units, pressure in pascals, volume in m³ The SI value, used in physics
R = 8.314 kPa·L / (mol·K) Pressure in kPa, volume in liters Handy when pressure is in kPa
R = 62.36 mmHg·L / (mol·K) Pressure in mmHg (torr), volume in liters For barometric pressures
Molar volume at STP 1 mole of any ideal gas at 0°C and 1 atm 22.414 liters
FAQ

Frequently asked questions

Is PV = nRT the same as the combined gas law?

They're related but not identical. The combined gas law relates two states of the same fixed amount of gas, as P1V1/T1 = P2V2/T2. The ideal gas law goes further by bringing in the amount of gas (n) and the constant R, so it describes a single state completely. PV = nRT is the more general equation, and the combined gas law falls out of it when n stays fixed.

The ideal gas law is PV = nRT, the equation that links the pressure, volume, amount, and temperature of a gas. P is pressure, V is volume, n is the number of moles, R is the gas constant, and T is the absolute temperature in kelvin. It combines Boyle's, Charles's, and Avogadro's laws into one tidy relationship that describes how an ideal gas behaves.

The formula is P × V = n × R × T. Rearranged, you get P = nRT/V, V = nRT/P, n = PV/RT, and T = PV/nR. This ideal gas law calculator solves any one of the four when you give it the other three, so you don't have to rearrange the equation by hand.

R is 0.082057 L·atm per mol·K when pressure is in atmospheres and volume is in liters, which is the value most chemistry classes use. In SI units it's 8.314 J per mol·K, with pressure in pascals and volume in cubic meters. The calculator picks the right R for the units you choose.

One mole of any ideal gas occupies 22.414 liters at standard temperature and pressure, which is 0°C (273.15 K) and 1 atmosphere. You can check it here: set n to 1, T to 273.15 K, and P to 1 atm, and the volume comes out to 22.414 L. It's a number worth memorizing for quick stoichiometry.

Yes, the formula needs absolute temperature, so T has to be in kelvin. If you've got Celsius, add 273.15; for Fahrenheit, convert to Celsius first, then add 273.15. This calculator lets you type the temperature in K, °C, or °F and converts to kelvin for you before it runs the math.

It works well for most gases at everyday pressures and temperatures, but it gets less accurate at very high pressure or very low temperature, where gas molecules crowd together and their own volume and attractions start to matter. For those conditions, real-gas equations like van der Waals do a better job. For homework and typical lab work, the ideal gas law is plenty close.

Keep going

Related calculators

Working through gas and solution problems? These chemistry tools pair well.

Need a quick gas calculation?

Try the calculator above, or browse every chemistry tool in the hub.

Chemistry tools