Skip to main content

Ideal Gas Law Calculator

Enter any three values, leave one empty. The calculator solves PV = nRT for the missing variable.

The ideal gas law

PV = nRT is the equation of state for an ideal gas — pressure times volume equals moles times the gas constant times absolute temperature. Four variables, one constraint, so given any three you can solve for the fourth. The fifth quantity, the gas constant R, is the same number every time but takes different numerical values depending on which units you use for P and V. R = 0.08206 L·atm/(mol·K) for atmospheres and liters; R = 8.314 J/(mol·K) for pascals and cubic meters. This calculator picks R from your unit selections automatically and converts °C to K before plugging in.

The non-obvious twist is the temperature: T must be in Kelvin, because the equation references absolute zero. Plug in Celsius or Fahrenheit and the math fails — at 0 °C the gas obviously hasn’t disappeared. The other twist is in the unit of pressure: atm, kPa, mmHg, and Pa all show up in textbooks, and the right value of R follows from your choice. The calculator handles those conversions internally so the units cancel correctly.

What the calculator does

  1. Enter values for any three of P, V, n, T.
  2. Pick units for each from the dropdowns.
  3. Leave the unknown blank.
  4. The calculator converts everything to a consistent unit set, picks the matching R, solves PV = nRT for the missing variable, and shows the substitution and arithmetic.

Worked examples

Find volume. 2.00 mol at 1.00 atm and 25.0 °C.

  • T = 25.0 + 273.15 = 298.15 K
  • V = nRT/P = (2.00 × 0.08206 × 298.15) / 1.00 = 48.9 L

Find pressure. 0.500 mol N2 in a 10.0 L container at 300 K.

  • P = nRT/V = (0.500 × 0.08206 × 300) / 10.0 = 1.23 atm

Find moles. 5.60 L at 1.50 atm and 350 K.

  • n = PV/RT = (1.50 × 5.60) / (0.08206 × 350) = 0.292 mol

Find temperature. 1.00 mol occupying 30.0 L at 0.800 atm.

  • T = PV/(nR) = (0.800 × 30.0) / (1.00 × 0.08206) = 292 K (19 °C)

Mixed units. 500 mL flask at 760 mmHg and 22 °C.

  • V = 0.500 L, P = 760 mmHg = 1.000 atm, T = 295.15 K
  • n = (1.000 × 0.500) / (0.08206 × 295.15) = 0.0207 mol

Where PV = nRT sits among the other gas laws

The empirical gas laws are special cases of PV = nRT with one or more variables held constant: Boyle’s (P1V1 = P2V2 at constant n, T), Charles’s (V1/T1 = V2/T2 at constant n, P), Avogadro’s (V1/n1 = V2/n2 at constant T, P), and the combined gas law (P1V1/T1 = P2V2/T2 at constant n) for two-state problems on the same sample. The full PV = nRT form is the most general; reach for the combined gas law when you have initial and final states of one fixed amount of gas.

Frequently Asked Questions

What is the ideal gas law?
PV = nRT relates the four state variables of a gas: pressure P, volume V, moles n, and absolute temperature T, connected by the gas constant R. Given any three, you can solve for the fourth. It is an equation of state for an idealized gas with no intermolecular forces and zero molecular volume — assumptions that hold reasonably well at low pressure and high temperature.
What value should I use for R?
R has different numerical values depending on the units of P and V. Use R = 0.08206 L·atm/(mol·K) when pressure is in atmospheres and volume in liters. Use R = 8.314 J/(mol·K) when pressure is in pascals and volume in cubic meters (i.e., when you want energy units). The calculator auto-selects R from the units you pick, so the answer comes out consistent.
Why must temperature be in Kelvin?
Because T appears multiplicatively in PV = nRT, the temperature has to be measured from absolute zero. Kelvin is anchored at absolute zero, where translational kinetic energy goes to zero. Plugging Celsius or Fahrenheit values gives nonsense — at 0 °C the gas is plainly not at zero pressure or volume. Convert °C to K by adding 273.15 before using the equation.
When does the ideal gas law break down?
Two main regimes: high pressure (molecules are close enough that their finite volume and attractive forces matter) and low temperature (kinetic energy no longer dominates intermolecular attractions). Both of those conditions push you toward condensation. The van der Waals equation adds an attractive-pressure correction (a) and an excluded-volume correction (b) and works much better in those regimes.
What is STP and what volume does one mole occupy?
Standard Temperature and Pressure: 273.15 K (0 °C) and 1 atm. Plugging those into PV = nRT for n = 1 gives V = 22.414 L. That number is the molar volume of an ideal gas at STP and is the shortcut behind most gas-stoichiometry problems. Note: IUPAC's modern STP uses 1 bar (not 1 atm), giving 22.711 L/mol — make sure you know which convention your textbook uses.