Ideal Gas Law Calculator
Calculate using PV = nRT
PV = nRT
Enter any 3 values to calculate the 4th
Understanding the Ideal Gas Law
The ideal gas law PV = nRT describes the relationship between pressure (P), volume (V), amount of gas in moles (n), and temperature (T), where R is the universal gas constant (0.08206 L·atm/mol·K).
This calculator solves for any unknown variable when the other three are provided. It is widely used in chemistry, physics, and engineering for gas behavior calculations.
The Four Variables
- Pressure (P): Measured in atmospheres (atm). Standard atmospheric pressure is 1 atm, equivalent to 101.325 kPa or 760 mmHg.
- Volume (V): Measured in liters (L). Represents the space occupied by the gas.
- Moles (n): The amount of gas in moles. One mole contains 6.022 × 10²³ molecules (Avogadro's number).
- Temperature (T): Must be in Kelvin (K). Convert from Celsius by adding 273.15. The ideal gas law does not work with Celsius or Fahrenheit directly.
When Does the Ideal Gas Law Apply?
The ideal gas law assumes gas molecules have negligible volume and no intermolecular forces. It works well at high temperatures and low pressures, where real gases behave most like ideal gases. At very high pressures or very low temperatures, real gas behavior deviates significantly, and equations like the van der Waals equation provide better accuracy.
Common applications include calculating the volume of a gas at standard temperature and pressure (STP), determining the number of moles in a gas sample, and predicting how changes in temperature or pressure affect gas volume.
Related Gas Laws
The ideal gas law combines several earlier laws: Boyle's law (P ∝ 1/V at constant T and n), Charles's law (V ∝ T at constant P and n), and Avogadro's law (V ∝ n at constant P and T). Understanding these individual relationships helps build intuition for gas behavior problems.
Worked example: pressure of a confined gas
A 10.0 litre vessel holds 2.00 mol of gas at 300 K. Finding the pressure is a direct application of PV equals nRT.
- Rearrange for the unknown. P equals nRT divided by V.
- Choose the gas constant that matches your units. To get an answer in atmospheres with volume in litres, use R equal to 0.08206 litre atmospheres per mole per kelvin.
- Check the temperature is absolute. 300 K is already in kelvin. Had the problem given 27 degrees Celsius, you would add 273.15 first.
- Substitute. P equals 2.00 times 0.08206 times 300, divided by 10.0.
Answer. The pressure is 4.92 atm. Had the temperature been entered as 27 rather than 300, the answer would have come out near 0.44 atm, an error of more than a factor of ten.
Common mistakes
These are the errors that come up most often, and each one changes the answer rather than merely looking untidy.
Using Celsius instead of Kelvin
This is the dominant error in gas law problems. The ideal gas law requires absolute temperature because it is proportional to temperature, and a scale with an arbitrary zero breaks that proportionality. Worse, at 0 degrees Celsius the equation would predict zero pressure. Always convert by adding 273.15.
Picking a gas constant that does not match the units
R is 0.08206 in litre atmospheres per mole per kelvin, but 8.314 in joules per mole per kelvin and 62.36 in litre millimetres of mercury per mole per kelvin. The number you choose must match the pressure and volume units in the problem, or the answer is wrong by a fixed factor.
Applying the ideal gas law where gases are not ideal
The law assumes molecules have no volume and do not attract one another. Both assumptions fail at high pressure and at temperatures near the point of liquefaction. For a gas near its boiling point or above roughly ten atmospheres, expect real deviations and consider the van der Waals equation.
Assuming standard temperature and pressure without being told
The molar volume of 22.414 litres applies only at standard conditions. Using it at room temperature introduces about an eight percent error, since room temperature is roughly 25 degrees Celsius rather than zero.
Frequently asked questions
Which value of R should I use?
Whichever one carries the units already in your problem. Use 0.08206 litre atmospheres per mole per kelvin for pressures in atmospheres and volumes in litres, and 8.314 joules per mole per kelvin when working in pascals and cubic metres or when the result feeds into an energy calculation.
When does the ideal gas law stop working?
At high pressure, where the molecules occupy a meaningful fraction of the container volume, and at low temperature, where intermolecular attraction becomes significant. As a rough guide it is reliable within a few percent below about ten atmospheres and well above the boiling point.
What exactly is STP?
Standard temperature and pressure is 273.15 K and one bar under the current IUPAC definition, giving a molar volume of 22.711 litres. Many textbooks still use the older definition of one atmosphere, which gives 22.414 litres. The difference is about one percent, so it is worth knowing which convention your course uses.
How do the combined and individual gas laws relate to this?
Boyle's, Charles's, and Gay-Lussac's laws are each the ideal gas law with two quantities held constant. The combined gas law is the same equation applied to a before and after state of the same sample, which is why the amount of gas and R cancel out of it.