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.
How to use the ideal gas law calculator
- 1Choose which quantity you want: pressure, volume, moles or temperature.
- 2Enter the other three, each with its own unit — atmospheres, litres and Celsius are fine.
- 3Press Calculate.
- 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?
Why must the temperature be in kelvin?
Does it want gauge or absolute pressure?
How accurate is the ideal gas law for a real gas?
Can it work in grams instead of moles?
Related tools
Pressure Converter
Converters
Convert between bar, psi, pascal, atmosphere, mmHg and eleven other pressure units.
Temperature Converter
Converters
Convert between Celsius, Fahrenheit and Kelvin instantly.
Molar Mass Converter
Converters
Work out molar mass from a chemical formula, then convert between grams and moles.
AC BTU Calculator
Calculators
Size an air conditioner for a room, with the adjustments for sun, ceiling height, occupants and kitchens.