The ideal gas law calculator solves PV = nRT for any one of the four state variables — pressure (P), volume (V), amount of substance (n) or temperature (T) — given the other three. It covers eight pressure units (Pa, kPa, MPa, bar, atm, psi, mmHg, torr), five volume units (m³, L, mL, cm³, ft³), three temperature scales (Kelvin, Celsius, Fahrenheit) and three molar units (mol, mmol, kmol), converting everything to SI internally before applying the formula and converting back to your preferred output unit.
The formula
The ideal gas law is:
PV = nRT
where each variable has a precise meaning:
- P — absolute pressure, in Pascals (Pa) internally
- V — volume, in cubic metres (m³) internally
- n — amount of gas, in moles (mol)
- T — absolute temperature, in Kelvin (K); subtract 273.15 from a Celsius reading to convert
- R — the universal gas constant, 8.314 462 618 J/(mol·K) (2018 NIST CODATA value)
Rearranging gives four solving forms:
| Solving for | Formula |
|---|---|
| Pressure | P = nRT / V |
| Volume | V = nRT / P |
| Moles | n = PV / (RT) |
| Temperature | T = PV / (nR) |
The calculator uses whichever row matches your selection, with all inputs converted to SI before the arithmetic and the result converted back to your chosen display unit.
How it works
Every input passes through an exact unit-conversion factor to Pascals (or m³, mol, or K). The four rearrangements are then simple one-line divisions. The result is converted from SI to the output unit you select independently, so you can, for example, enter pressure in atm, volume in litres and temperature in Celsius, then read the mole count directly. The “Show working” panel displays all four SI values so you can verify the arithmetic step by step.
The gas constant used is R = k × N_A = 1.380 649 × 10⁻²³ × 6.022 140 76 × 10²³ = 8.314 462 618 J/(mol·K), which is the exact value implied by the 2019 SI redefinition.
Worked example
Problem: A sealed 5-litre flask contains 0.25 mol of nitrogen gas at 20 °C. What is the pressure in atm?
Step 1 — convert to SI:
- V = 5 L = 0.005 m³
- n = 0.25 mol
- T = 20 °C = 293.15 K
Step 2 — apply P = nRT / V:
- P = (0.25)(8.314 462 618)(293.15) / 0.005
- P = (0.25 × 2438.0) / 0.005
- P = 609.5 / 0.005
- P = 121 900 Pa
Step 3 — convert to atm: 121 900 / 101 325 = 1.203 atm
So the flask holds approximately 1.2 atmospheres — slightly above standard atmospheric pressure, which is typical for a gas stored at room temperature.
Common reference points
| Condition | P | V per mol |
|---|---|---|
| IUPAC STP (0 °C, 1 bar) | 100 kPa | 22.711 L |
| Old STP (0 °C, 1 atm) | 101.325 kPa | 22.414 L |
| Room temperature (25 °C, 1 atm) | 101.325 kPa | 24.465 L |
| Body temperature (37 °C, 1 atm) | 101.325 kPa | 25.447 L |
All calculations run entirely in your browser — no data is ever uploaded or stored.