Skip to content
ToolBoxGeniehome

Ideal Gas Law Calculator

Calculators · Added

Leave one of the four quantities blank and this solves PV = nRT for it. Every input is converted to pascals, cubic metres, moles and kelvin before the equation is touched, because almost every real mistake with the gas law is a unit mistake — and the working is shown in SI so you can check it against your own.

Solve for

Standard conditions

Not a gauge reading

mol
g/mol

Only used to convert the moles into a mass

How to use the ideal gas law calculator

  1. 1Choose which quantity you want: pressure, volume, moles or temperature.
  2. 2Enter the other three, each with its own unit — atmospheres, litres and Celsius are fine.
  3. 3Press Calculate.
  4. 4Read the answer, and the SI values underneath if you are checking working.

Examples

The molar volume of a gas at STP

Input
1 mol at 1 atm and 0 °C, solving for volume
Result
22.414 L — the number school chemistry quotes, derived rather than looked up

Moles in a cylinder

Input
200 bar, 50 L, 20 °C, solving for moles
Result
About 410 mol — with a note that at 197 atmospheres a real gas departs from the ideal law by several per cent

Celsius where kelvin belongs

Input
A temperature of 0 °C entered as 0 K
Result
Refused, with the reason: at absolute zero the equation divides by nothing

This is the most common gas law error and the one that produces the most confident wrong answers.

About the ideal gas law calculator

One law from three older ones

The ideal gas law is what you get when Boyle's, Charles's and Avogadro's laws are written as one statement. Boyle found that pressure and volume trade off at fixed temperature, Charles that volume rises with absolute temperature, Avogadro that equal volumes hold equal numbers of molecules. PV = nRT contains all three: hold any two variables and it collapses to whichever of the older laws describes the rest.

That is also why the combined gas law — P₁V₁/T₁ = P₂V₂/T₂ — is not a separate thing to learn. It is this equation applied twice to the same gas, with nR cancelling because the amount has not changed. If you are comparing a gas before and after a change, solve for the missing quantity in each state and compare.

What the gas constant actually is

R looks like an empirical fudge factor and is not. It is the Boltzmann constant — the energy per kelvin of a single molecule's worth of thermal motion — multiplied by Avogadro's number to scale it up to a mole. Written that way, PV = nRT says that the pressure a gas exerts is the total kinetic energy of its molecules divided by the space they are in.

Since 2019 both of those constants are defined exactly, as part of the SI redefinition that also fixed the kilogram. R inherits that exactness, which is unusual: most constants in a calculator carry a measurement uncertainty, and this one carries none.

Where it stops working, and what that feels like

Two assumptions fail as a gas is compressed or cooled. Molecules do take up space, so the volume available to them is less than the container's, which makes real pressure higher than predicted. And they do attract each other, which pulls them inward and makes real pressure lower. The two effects work in opposite directions and one or the other dominates depending on conditions, which is why the error is not a simple correction factor.

Near the point where a gas would condense, the departure becomes total: the ideal law has no concept of a liquid and will happily report a volume for something that has already turned into one. If your conditions are near a boiling point at the pressure in question, the number this returns is arithmetic rather than physics.

Frequently asked questions

Which value of R does this use?
8.314462618153 J mol⁻¹ K⁻¹, and only that one. Since the 2019 SI redefinition R is exact — it is the Avogadro constant multiplied by the Boltzmann constant, both of which are now defined rather than measured — so there is no uncertainty attached to it. Versions of R in L·atm or cal are not used anywhere here: carrying several forms of a constant is how they drift apart, so everything is converted to SI instead.
Why must the temperature be in kelvin?
Because the law is proportional to absolute temperature, and Celsius has its zero in the wrong place. Doubling from 10 °C to 20 °C is not doubling the temperature — it is going from 283.15 K to 293.15 K, a rise of 3.5%. Using Celsius directly does not give a slightly wrong answer, it gives a meaningless one, and at 0 °C it asks the equation to divide by zero. Celsius and Fahrenheit are accepted as inputs and converted immediately.
Does it want gauge or absolute pressure?
Absolute, always. A gauge measures the difference from atmospheric pressure, so a tyre gauge reading 2.2 bar is about 3.2 bar absolute. Putting the gauge figure into PV = nRT understates the pressure by one atmosphere, which at everyday pressures is a large error. Nothing can detect the mistake from the number alone, so the tool states the requirement rather than guessing.
How accurate is the ideal gas law for a real gas?
Very good at everyday conditions and worse than people expect at extremes. It assumes molecules that take up no space and do not attract each other, which is close to true for air at room temperature and one atmosphere. By ten atmospheres the error is a few per cent, and near a gas's condensation point or critical point it is much larger. The result carries a note when your conditions are in that territory; a real-gas equation such as van der Waals is the tool for it.
Can it work in grams instead of moles?
Enter a molar mass and the result reports the mass alongside the moles. The equation itself only knows about the amount of substance — how many molecules there are — so the conversion is a separate step, and it needs the molar mass of the specific gas. The molar mass converter will work that out from a formula.