Ideal Gas Law Calculator
Solve the ideal gas law for any one of its four quantities, given the other three.
What this calculator does
Enter any three of pressure, volume, moles and temperature, and the calculator solves the ideal gas law for the fourth. The defaults reproduce the most famous number in gas chemistry: 1 mole of gas at 273.15 K (0 °C) and 101,325 Pa (1 atmosphere) occupies exactly 0.022414 m³ — 22.414 litres, the molar volume every stoichiometry course memorises.
The ideal gas law
Here P is pressure in pascals, V volume in cubic metres, n the amount in moles, T temperature in kelvin, and R the universal gas constant 8.314 J/(mol·K). The equation bundles three older gas laws into one: Boyle’s law (P V constant at fixed n and T), Charles’s law (V proportional to T at fixed P and n), and Avogadro’s law (V proportional to n at fixed P and T).
Physically, the law says a gas is a swarm of point particles whose pressure comes from collisions with the walls. Pressure times volume has units of energy (Pa × m³ = N/m² × m³ = N·m = J), and nRT is the thermal energy scale of the gas — so the law equates two energies, which is why it works in any consistent energy-based unit set.
Units matter
The value of R = 8.314 assumes pascals, cubic metres, moles and kelvin. Temperature must be absolute (kelvin), never Celsius: 0 °C is 273.15 K, and using the raw Celsius number would return a volume of essentially nothing at freezing — a physically absurd answer. Volumes in litres must be divided by 1,000 to enter as m³, and pressure in bar multiplied by 100,000 to reach pascals.
Worked example at the defaults
Check the molar volume: V = nRT ÷ P = 1 × 8.314 × 273.15 ÷ 101,325 = 2,271.0 ÷ 101,325 = 0.022414 m³ = 22.414 L. That is a cube about 28.2 cm on a side holding roughly 6.02 × 10²³ molecules of any gas — helium, nitrogen or methane, the law is deliberately blind to the species.
The other three solves are the same arithmetic reshuffled. Heating that litre-scale sample to 298.15 K (25 °C) at constant pressure stretches it to V = 8.314 × 298.15 ÷ 101,325 = 0.024466 m³ — about 24.47 L, the number behind the everyday rule that gases expand roughly 1/273 of their volume per degree Celsius. Compressing it instead to a 20 L scuba tank volume at the same temperature would need P = 2,271.0 ÷ 0.02 = 113,550 Pa per mole — and a real fill is hundreds of moles, which is how tank pressures reach 200 bar.
Reference conditions and molar volumes
| Condition | Temperature | Pressure | Molar volume |
|---|---|---|---|
| STP (the defaults) | 273.15 K | 101,325 Pa | 22.414 L |
| Room conditions (SATP) | 298.15 K | 100,000 Pa | 24.79 L |
| Room at 1 atm | 298.15 K | 101,325 Pa | 24.47 L |
| Hot day, 40 °C at 1 atm | 313.15 K | 101,325 Pa | 25.70 L |
The rows differ by only a few percent, but those percent differences matter when you convert gas volumes to moles for a reaction calculation. Chemistry textbooks quoting 22.4 L assume the STP row; industrial gas sales quoting standard cubic metres usually assume a 15 °C or 20 °C reference — always check which row a supplier means before comparing prices.
What moves each output
- Temperature doubles, pressure doubles (fixed volume): 1 mol in 0.022414 m³ at 546.3 K presses with 202,650 Pa.
- Volume halves, pressure doubles (fixed T): squeezing the default gas into 0.011207 m³ gives 202,650 Pa.
- Moles set the scale: 2 mol in the default conditions occupy 0.044828 m³, exactly double the molar volume.
- Absolute zero is the hard floor: at T = 0 the law gives P = 0 — which is why Celsius must never be fed in raw.
The proportional shortcuts inside the law
When only one pair of variables changes at a time, the full equation reduces to a ratio: P&sub1;V&sub1;/T&sub1; = P&sub2;V&sub2;/T&sub2; for a fixed amount of gas. A weather balloon at ground level (101,325 Pa, 293.15 K, 1 m³) rising to a level of 20,000 Pa and 220 K expands to V&sub2; = P&sub1;V&sub1;T&sub2;/(P&sub2;T&sub1;) = (101,325 × 1 × 220) ÷ (20,000 × 293.15) ≈ 3.80 m³. That near-fourfold expansion is why high-altitude balloons are launched only partly inflated.
Common mistakes and edge cases
- Feeding Celsius into T: 25 °C is 298.15 K, and the raw number under-reports the energy scale by a factor of about 12.
- Mixing litres with m³: 22.414 L is 0.022414 m³, and the slip inflates or deflates results by a factor of 1,000.
- Using R = 0.0821 with SI units: that value belongs to L·atm units; the calculator’s 8.314 needs pascals and cubic metres.
- Trusting the law near condensation: steam below 100 °C at 1 atm is liquid, and the ideal model quietly stops describing reality.
The ideal model itself has limits worth naming. It treats molecules as point particles with no mutual attraction, which is excellent for helium and nitrogen at room conditions (errors well under 1 percent) but degrades at high pressure and low temperature, where molecules crowd together. Real gas corrections such as the van der Waals equation take over there; for everyday chemistry from 0 °C to 40 °C near atmospheric pressure, the defaults above are accurate to the last digit shown.
Everyday gas law numbers
A few anchor cases put the scale in reach. The air in a typical bedroom of 30 m³ at 20 °C and 1 atm holds n = PV ÷ RT = (101,325 × 30) ÷ (8.314 × 293.15) ≈ 1,249 mol — about 36 kg of invisible gas. A 2 L soda bottle pressurised to 3.5 bar absolute at 4 °C (277.15 K) holds n = (350,000 × 0.002) ÷ (8.314 × 277.15) ≈ 0.304 mol, the fizz behind roughly 7 litres of CO₂ gas at STP. And one breath of 0.5 L is about 0.021 mol, which is why lung-capacity problems resolve so cleanly with this law.
Frequently asked questions
What is the ideal gas law?
It is the equation PV = nRT, relating pressure, volume, moles and temperature of an ideal gas. Knowing any three of the four solves for the fourth.
What is the value of R?
The gas constant R is 8.314 J/(mol·K) when pressure is in pascals and volume in cubic metres.
Why must temperature be in kelvin?
Because the law uses absolute temperature. Celsius values would give incorrect results, so add 273.15 to convert — 25 °C becomes 298.15 K.
What volume does 1 mole of gas occupy at STP?
22.414 litres, or 0.022414 m³, which is exactly what the defaults reproduce: 1 mol at 273.15 K and 101,325 Pa.
How do I convert litres to cubic metres for the calculator?
Divide by 1,000. A 20 L tank is 0.02 m³, and forgetting the conversion shifts the answer by three orders of magnitude.
What pressure does the default gas reach if heated to 25 °C at constant volume?
P = nRT ÷ V = (8.314 × 298.15) ÷ 0.022414 ≈ 110,570 Pa, about a 9 percent rise over the 101,325 Pa default.
Does the gas type matter?
Not to this law — it depends only on the number of moles. Helium, nitrogen and methane all fill 22.414 L per mole at STP; differences appear only with real-gas corrections.
How many moles are in a 30 m³ bedroom at 20 °C?
n = PV ÷ RT = (101,325 × 30) ÷ (8.314 × 293.15) ≈ 1,249 mol, which is about 36 kg of air.
When does the ideal gas law break down?
At high pressures and low temperatures near condensation, where molecules attract and occupy real volume. Under everyday room conditions the error is well under 1 percent.
How does a weather balloon use the combined gas law?
For fixed n, P&sub1;V&sub1;/T&sub1; = P&sub2;V&sub2;/T&sub2;. Rising from 101,325 Pa and 293.15 K to 20,000 Pa and 220 K expands 1 m³ to about 3.8 m³.
Method and sources
- Ideal gas law (PV = nRT).