Ideal Gas Law

Solve for pressure

Compare Calculations

Downloads

Includes your inputs and results for this calculation, plus any additional calculations you've compared.

Solving PV = nRT for Any One Variable

The ideal gas law relates a gas’s pressure, volume, amount, and temperature in a single equation: PV = nRT. Enter any three of pressure, volume, moles, and temperature, and this calculator solves for the fourth.

This relationship is one of the foundational equations of chemistry and physics, combining Boyle’s law (pressure and volume), Charles’s law (volume and temperature), and Avogadro’s law (volume and amount) into one formula that works for any of these variables held constant or changing.

The Formula

PV=nRTPV = nRT

Where $P$ is pressure (atmospheres), $V$ is volume (liters), $n$ is the amount of gas (moles), $T$ is absolute temperature (kelvin), and $R$ is the ideal gas constant, 0.0821 L·atm/(mol·K) in these units. Temperature must always be in kelvin — Celsius or Fahrenheit have an arbitrary zero point that would make the equation give the wrong answer, not just a differently labeled one.

Worked Example

At standard temperature and pressure (STP: 0°C, or 273.15 K, and 1 atm), what volume does exactly 1 mole of an ideal gas occupy?

  1. Rearranging for volume: V=nRTPV = \frac{nRT}{P}.
  2. Plugging in: V=1×0.0821×273.15122.4V = \frac{1 \times 0.0821 \times 273.15}{1} \approx 22.4 liters — the widely cited “molar volume” of an ideal gas at STP.

Doubling the temperature (at the same pressure and amount) doubles the volume; doubling the pressure (at the same temperature and amount) halves the volume.

Key Factors to Consider

  • The three “special case” gas laws are all this same equation with one variable held constant. Boyle’s law (constant temperature and amount), Charles’s law (constant pressure and amount), and Avogadro’s law (constant temperature and pressure) each describe a simplified slice of PV = nRT — recognizing which variables are fixed in a given problem often makes it easier to reason through than the full four-variable equation.
  • The gas constant R has different numeric values depending on which units you use. This calculator uses R = 0.0821 L·atm/(mol·K), matching liters, atmospheres, and kelvin — using different pressure or volume units (like pascals or cubic meters) requires a different value of R, so always match the constant to the unit system actually in use.
  • Real gases deviate most from ideal behavior at high pressure and low temperature. Under those conditions, the assumptions behind the ideal gas law (no molecular volume, no intermolecular attraction) break down most noticeably — the Van der Waals equation is a common refinement that corrects for these effects when higher precision is needed.
  • This equation assumes a fixed, unchanging amount of gas unless you’re solving for moles directly. If gas is added to or removed from a system during a process, the calculation needs to track the changing amount of gas (n) as its own variable, not treat it as constant throughout.

Common Mistakes

  • Entering temperature in Celsius or Fahrenheit instead of kelvin. Because these scales have an arbitrary zero point, plugging them directly into PV = nRT gives a genuinely wrong answer, not just a mislabeled one — always convert to kelvin first (add 273.15 to Celsius).
  • Mixing units that don’t match the gas constant. R = 0.0821 L·atm/(mol·K) only works with liters, atmospheres, and kelvin — entering volume in cubic meters or pressure in pascals without converting first, or without switching to a different value of R, produces a wrong result.
  • Forgetting a real gas isn’t perfectly ideal. The equation is a very good approximation at ordinary conditions, but it can noticeably overstate accuracy at high pressure or low temperature, where real molecular volume and intermolecular attraction start to matter.
  • Treating a changing amount of gas as a fixed constant. If moles of gas are added or removed partway through a process, n needs to be tracked as its own changing variable, not assumed constant throughout the whole calculation.

Useful to Know

  • Need to know how much of a solute is dissolved in a solution rather than a gas’s own properties? The Molarity & Dilution Calculator calculator handles concentration instead.
  • Working from a substance’s mass rather than its moles directly? The Molar Mass Calculator calculator converts between the two.
  • Curious how heating a gas (or any substance) relates to the energy involved? The Heat Energy Calculator calculator estimates the energy needed for a given temperature change.

Source: Ideal gas law, the equation of state for an ideal gas.

Frequently Asked Questions

What does the ideal gas law actually say?

PV = nRT relates a gas’s pressure (P), volume (V), amount in moles (n), and absolute temperature (T), tied together by the gas constant R. Knowing any three of the four lets you solve for the fourth.

Why does temperature have to be in kelvin?

The ideal gas law only holds true on an absolute temperature scale, where zero really means zero molecular motion. Celsius or Fahrenheit both have an arbitrary zero point, which would make the math wrong, not just differently labeled -- always convert to kelvin first (add 273.15 to Celsius).

How accurate is the ideal gas law for a real gas?

It’s a very good approximation for most gases at ordinary temperatures and pressures, but it assumes gas particles have no volume and no attraction to each other. Real gases deviate from this at very high pressure or very low temperature, where more advanced equations of state are needed.

Confirm Your Age

To create an account, please tell us your birth month and year.