Ideal Gas Law Calculator (PV = nRT)
Solve the ideal gas law PV = nRT for pressure, volume, moles, or temperature. Enter any three values and get the fourth with step-by-step working.
Ideal gas law formula
The ideal gas law relates the pressure, volume, amount, and temperature of an ideal gas:
- P — pressure, in pascals (Pa) — always positive
- V — volume, in cubic metres (m³) — always positive
- n — amount of gas, in moles (mol) — always positive
- R — the gas constant, 8.314 J/(mol·K) (a fixed constant here)
- T — absolute temperature, in kelvin (K) — always positive
Enter any three values and leave the fourth blank; the calculator solves for it and shows the substitution step.
Worked example
A gas sample has 2 mol at 300 K in a 0.05 m³ container. What is its pressure?
- Formula: P = nRT/V
- Substitute: P = 2 × 8.314 × 300 / 0.05
- Result: P = 99768 Pa
Solving in reverse
The same formula rearranges to find moles, temperature, or volume when the other three values are known:
- Moles: n = PV/(RT) — enter P, V, and T, leave n blank.
- Temperature: T = PV/(nR) — enter P, V, and n, leave T blank.
- Volume: V = nRT/P — enter n, T, and P, leave V blank.
For example, with P = 99768 Pa, V = 0.05 m³, and T = 300 K, n = 99768 × 0.05 / (8.314 × 300) = 2 mol.
Common mix-ups
- Using Celsius instead of Kelvin. This is the single most common ideal gas law mistake — always convert to Kelvin (K = °C + 273.15) first.
- Inconsistent units elsewhere. Pressure must be in pascals and volume in cubic metres for R = 8.314 J/(mol·K) to apply directly — convert atm, litres, or other units to SI first.
- Forgetting the gas is "ideal." Real gases at extremely high pressure or low temperature depart from this law; it's an approximation valid for most everyday conditions.
Where this shows up
The ideal gas law describes compressed air in tanks, the behavior of gas in a balloon as it heats or cools, and the basic thermodynamics behind engines. It connects to density (a gas's density depends on how much mass fits in the same volume) and to pressure more generally, since P = F/A is the mechanical definition that the ideal gas law extends to gases.
Frequently asked questions
- What is the ideal gas law formula?
- The ideal gas law is PV = nRT, where P is pressure in pascals (Pa), V is volume in cubic metres (m³), n is the amount of gas in moles (mol), R is the gas constant (8.314 J/(mol·K)), and T is absolute temperature in kelvin (K).
- Why must temperature be in Kelvin, not Celsius?
- The ideal gas law requires absolute temperature because it's derived from the kinetic theory of gases, where T represents average molecular kinetic energy — that scale starts at absolute zero (0 K), not at the freezing point of water. Convert Celsius to Kelvin with K = °C + 273.15 before entering it.
- What is the value of the gas constant R?
- R = 8.314 J/(mol·K) (joules per mole-kelvin) is used throughout this calculator — it's a fixed physical constant, not something you enter.
- How do I find the number of moles of gas?
- Rearrange the formula to n = PV / (RT). Enter the pressure, volume, and temperature (in Kelvin), leave moles blank, and the calculator solves for n automatically.
- Can pressure, volume, moles, or temperature be negative or zero?
- No — all four quantities are physical measurements that must be strictly greater than zero. A temperature of 0 K or below, or a zero/negative pressure, volume, or mole count, isn't physically meaningful for this law.
- Does the ideal gas law work for any gas?
- It's an approximation that works well for most gases at ordinary temperatures and pressures, treating gas molecules as points with no volume and no attractive forces. Real gases deviate from it at very high pressure or very low temperature, where more complex equations of state are needed.