An ideal gas law calculator with units and steps
The ideal gas law, PV = nRT, links the pressure, volume, amount and temperature of a gas. This ideal gas law calculator solves it for whichever of the four you do not know, accepts the units you actually have (kPa, bar, atm, mmHg, psi; litres, cubic metres, cubic feet, gallons; °C, K, °F) and shows the conversion to SI and every step of the working.
You can enter the amount of gas in moles or as a mass in grams, kilograms or pounds. Mass uses the molar mass of the gas you pick, so the same page covers the PV = nRT chemistry form and the PV = mRsT engineering form, where Rs is the specific gas constant of the gas. The result also gives the gas density, the mass and the molar volume at your conditions.
The ideal gas law is an excellent approximation for gases at moderate pressure and well above their boiling point, and a poor one at high pressure or near condensation. The calculator warns you when you leave that range.
How to use the Ideal Gas Law Calculator
- Choose the variable to solve for: volume, pressure, amount or temperature.
- Fill in the other three, picking the unit beside each. The box of the quantity you solve for is ignored and its unit becomes the answer’s unit.
- Select the gas if you work in mass or want density, or enter a custom molar mass.
- Read the answer, then open the steps to check each conversion.
Ideal Gas Law Calculator features
Any unit
Pressure, volume, amount and temperature units are converted for you.
Moles or mass
PV = nRT and PV = mRsT in one tool.
Density and molar volume
Gas density, mass and specific gas constant at your conditions.
Step by step
SI conversion, rearranged formula and the converted answer.
The equation and its constants
The law is PV = nRT, with pressure in pascals, volume in cubic metres, n in moles and T in kelvin, and the gas constant R = 8.314 462 618 J/(mol·K), an exact value since the 2019 redefinition of the SI. Rearranged: V = nRT ÷ P, P = nRT ÷ V, n = PV ÷ RT and T = PV ÷ nR. Dividing the amount by the molar mass M gives the mass form PV = mRsT with Rs = R ÷ M, and the density is ρ = P M ÷ R T.
Example: one mole of gas at 0 °C (273.15 K) and 101.325 kPa occupies 8.314462618 × 273.15 ÷ 101,325 = 0.022414 m³, or 22.414 L. At 25 °C and 100 kPa the molar volume is 24.790 L, and for dry air at 20 °C and 1 atm the density works out to about 1.204 kg/m³.
| Quantity | SI unit | Common conversions |
|---|---|---|
| Pressure | Pa | 1 atm = 101,325 Pa; 1 bar = 100,000 Pa; 1 psi = 6,894.76 Pa |
| Volume | m³ | 1 L = 0.001 m³; 1 ft³ = 0.0283168 m³ |
| Temperature | K | K = °C + 273.15 |
| Amount | mol | n = mass ÷ molar mass |
When the ideal law is not enough
- At pressures above roughly 50 bar, or near the temperature where the gas liquefies, use the real-gas form PV = ZnRT with a compressibility factor Z.
- Steam and refrigerants near saturation need property tables, not the ideal law; see the steam table calculator.
- Temperatures must be absolute in the formula, which is why the calculator converts °C and °F to kelvin first.
- Gauge pressure is not absolute pressure. Add atmospheric pressure to a gauge reading before using this page.
Ideal Gas Law Calculator FAQ
How do I use the ideal gas law calculator?
Pick what to solve for, enter the other three quantities with their units and read the answer. Remember that pressure must be absolute and the calculator converts temperature to kelvin.
How do I calculate gas density from the ideal gas law?
ρ = P M ÷ (R T). For air (M = 28.9647 g/mol) at 101,325 Pa and 293.15 K that is about 1.204 kg/m³; the calculator shows the density for any gas you choose.
What is the PV = mRT form?
It is the same law written with the mass m of the gas and the specific gas constant R = R ÷ M of that gas. Enter the amount in kilograms and pick the gas to use it.
What value of R does it use?
8.314 462 618 J/(mol·K). The calculator converts your units to SI, so you never need to pick a different R such as 0.08206 L·atm/(mol·K).
Why does the answer look wrong at high pressure?
The ideal law neglects molecular volume and attraction, so real gases deviate above tens of bar. A compressibility factor corrects it.
Is gauge pressure accepted?
No. Convert gauge to absolute by adding the local atmospheric pressure first.