CODDY Tool

Ideal Gas Law Calculator

PV = nRT — solve for pressure, volume, amount or temperature, given the other three.

Enter any three of pressure, volume, amount of gas and temperature, and this solves for the fourth using PV = nRT — in a fixed set of units (atm, litres, moles, kelvin) chosen so nothing gets silently mismatched.

Everything you enter stays in this browser tab. Nothing is sent to our servers, logged or stored.

Loading tool…

About Ideal Gas Law Calculator

PV = nRT ties together the four quantities that describe a gas's state: pressure, volume, the amount present (in moles) and temperature. It's an approximation — real gas molecules have volume and attract each other slightly, neither of which this model accounts for — but it's an extremely good one for most everyday conditions, and the standard starting point for any gas calculation.

The gas constant R depends entirely on which units the other four quantities are expressed in, and mixing units without converting first is the single most common ideal gas law mistake — using atmospheres for one calculation and kPa for the next, without swapping which R value goes with it, silently produces a wrong answer that still looks plausible. This fixes the units throughout — atmospheres, litres, moles, kelvin — specifically so that mismatch can't happen.

Temperature has to be in kelvin, not Celsius or Fahrenheit, because the relationship is proportional (double the kelvin temperature, double the pressure at fixed volume and amount) and that only holds on a scale where zero actually means zero — Celsius's zero is arbitrary, kelvin's is absolute zero. Convert with +273.15 before entering a Celsius temperature here.

How to use the ideal gas law calculator

  1. Enter three of the four values

    Pressure (atm), volume (L), amount (mol), temperature (K).

  2. Convert temperature to kelvin first

    °C + 273.15 = K.

  3. Read the fourth value

    Calculated directly from the other three.

Frequently asked questions

Why does temperature have to be in kelvin?

The ideal gas law is a proportional relationship — it assumes doubling the temperature (at fixed volume and amount) doubles the pressure — which only holds true measured from absolute zero. Celsius and Fahrenheit both have arbitrary zero points, so plugging a Celsius value in directly gives a wrong answer even though the number looks reasonable.

Why are the units fixed to atm, L, mol and K?

The gas constant R has a different numeric value for every combination of units, and using the wrong R for your units — or the right R with the wrong units — is the classic ideal gas law error. Fixing all four units removes that failure mode entirely; convert your values into these units first (the Unit Converter handles pressure and volume) rather than trying to match a different R by hand.

How accurate is the ideal gas law in practice?

Very good at typical conditions — room temperature, roughly atmospheric pressure, common gases like air or oxygen. It breaks down more noticeably at high pressure or low temperature, where the real gas's own volume and the attraction between its molecules — both ignored by this model — start to actually matter.

Can this be used for a mixture of gases?

Yes, treating n as the total moles of all gases combined and using the mixture's total pressure — that's exactly what Dalton's law of partial pressures builds on. This calculator itself doesn't split a mixture into its individual components; it just needs the total amount and total pressure.

Ideal Gas Law Calculator is free to use with no account, no watermark and no usage limits. Last updated 7 September 2026.