Calculate absolute pressure, volume, moles, or temperature using PV = nRT, with unit conversion, optional gas mass and density, and an illustrative comparison with the van der Waals model.
Ideal Gas Law Formula
Rearranged for each variable the calculator can solve:
- P = absolute pressure of the gas (Pa in SI)
- V = volume the gas occupies (m3 in SI)
- n = amount of gas (mol)
- R = universal gas constant, 8.31446 J/(mol·K)
- T = absolute temperature (K)
The value of R changes with the units you feed it: 8.31446 J/(mol·K) for pascals and cubic meters, 0.082057 L·atm/(mol·K) for liters and atmospheres, and 0.083145 L·bar/(mol·K) for liters and bar. The calculator sidesteps that problem by converting every input to pascals, cubic meters, moles and kelvin, solving with the SI value of R, then converting the answer back into the units you want to read.
What each part of the calculator does:
- The solve-for selector picks which of the four rearrangements above is used and hides the field for that variable, so only the three knowns stay on screen.
- Temperature is always converted to kelvin before the math. Entering 25 °C gives 298.15 K, not 25.
- The amount of gas can be entered as moles or as a mass. Mass is divided by the molar mass to get n, which is what the equation actually needs.
- Selecting a gas adds molar mass driven outputs: total mass, density in g/L, and molar volume in L/mol.
- The optional comparison evaluates the van der Waals pressure at the same temperature and molar volume, using the retained approximate gas parameters. Its pressure ratio is model disagreement, not a measured compressibility factor or a verified error bound. Agreement between approximate models does not establish actual gas accuracy or phase stability.
Where PV = nRT Stops Being Accurate
The ideal gas law neglects molecular volume and intermolecular attractions. These approximations become less reliable at high pressure or near phase transitions. The table gives illustrative van der Waals pressure ratios at the ideal molar volume for 1 atm and 25 °C. Critical temperatures are approximate reference values. No universal safe pressure or accuracy limit is established here; use validated property data for the gas and conditions.
| Gas | Molar mass (g/mol) | Critical temp (K) | Model ratio at ideal molar volume | Validated pressure limit |
|---|---|---|---|---|
| Helium | 4.00 | 5.2 | 1.000917 | Not established |
| Hydrogen | 2.02 | 33.2 | 1.000681 | Not established |
| Nitrogen | 28.01 | 126.2 | 0.999325 | Not established |
| Oxygen | 32.00 | 154.6 | 0.999025 | Not established |
| Argon | 39.95 | 150.9 | 0.999076 | Not established |
| Methane | 16.04 | 190.6 | 0.997987 | Not established |
| Carbon dioxide | 44.01 | 304.1 | 0.995745 | Not established |
| Ammonia | 17.03 | 405.5 | 0.994551 | Not established |
| Water vapor | 18.02 | 647.1 | 0.992118 | Not established |
Both temperature and pressure affect departures from ideal behavior. The model does not identify condensation or phase equilibrium. Use measured gas-specific compressibility or a validated equation of state when accuracy matters.
The following table describes the optional model pressure ratio. It is not an actual-gas accuracy certification.
| Model pressure ratio | What it means | What to do |
|---|---|---|
| 0.99 to 1.01 | Attractions and molecular volume nearly cancel | Models nearly agree; actual accuracy unverified |
| 0.95 to 0.99 | Attractions dominate slightly; real volume is smaller than predicted | Approximate model disagreement only |
| Below 0.95 | Attractive term lowers model pressure; phase not determined | Use validated property data for the actual gas and conditions |
| Above 1.05 | Molecular volume dominates; gas resists compression | Excluded-volume term raises model pressure; verify with property data |
Example Problems
Example 1: find the pressure. You have 1.00 mol of air in a 22.4 L vessel at 273.15 K.
- Convert the volume to SI: 22.4 L = 0.0224 m3.
- Multiply n, R and T: 1.00 × 8.31446 × 273.15 = 2271.1 J.
- Divide by volume: P = 2271.1 / 0.0224 = 101,388 Pa.
- Convert: 101,388 Pa = 1.0006 atm. The molar volume is 22.4 L/mol and the density of air here is 1.29 g/L. The van der Waals comparison is close to the ideal pressure here, which does not independently verify actual-gas accuracy.
Example 2: find the amount of gas. A 10.0 L cylinder of air sits at 2.00 atm and 300 K.
- Convert: 2.00 atm = 202,650 Pa and 10.0 L = 0.0100 m3.
- Multiply P by V: 202,650 × 0.0100 = 2026.5 J.
- Multiply R by T: 8.31446 × 300 = 2494.3 J/mol.
- Divide: n = 2026.5 / 2494.3 = 0.8124 mol. At a molar mass of 28.96 g/mol that is 23.5 g of air, or 4.89 × 1023 molecules.
FAQ
Do I have to convert temperature to kelvin?
Yes. The ideal gas law is built on absolute temperature, where zero means zero molecular kinetic energy. Using 25 instead of 298.15 K makes the answer wrong by a factor of about 12, and using a negative Celsius value produces a negative pressure or volume, which is physically meaningless. Rankine works too if you pair it with an R value in Rankine. The calculator accepts Celsius, Fahrenheit and Rankine and converts them for you.
Which value of R should I use?
Match R to your units. Use 8.31446 J/(mol·K) with pascals and cubic meters, 0.082057 L·atm/(mol·K) with liters and atmospheres, 0.083145 L·bar/(mol·K) with liters and bar, and 62.364 L·torr/(mol·K) with liters and torr. Mixing an R value with the wrong pressure unit is the single most common error on ideal gas problems, and it usually shows up as an answer that is off by a factor of 101,325 or 760.
When should I stop using the ideal gas law?
Use validated real-gas data when the required accuracy cannot be established, especially at high pressure, low temperature or near a phase change. A ratio near 1 between the ideal and van der Waals models is not proof of accuracy. With a validated compressibility factor, PV = ZnRT.
