Skip to content
Physics

Ideal Gas Law Calculator (PV = nRT)

The ideal gas law PV = nRT ties together the pressure, volume, amount and temperature of a gas. Pick which one you want to solve for, enter the other three in the units you have, and get the answer plus the number of molecules, the molar volume, and (with a molar mass) the sample mass and density.

Your details

Enter the other three values and the calculator rearranges PV = nRT to find this one.
Result
0.9994
Amount of gas0.9994mol
Molecules601,838,950,998,954,240,000,000
Molar volume22.414L/mol
Pressure (atm)1
Volume (L)22.4
Temperature (K)273.15

Solved for amount of gas: 0.9994.

  • At 1 atm, 22.4 L and 273.15 K this sample holds 0.9994 mol (601,838,950,998,954,240,000,000 molecules).
  • Temperature must be absolute (kelvin); the calculator converts °C or °F for you before applying PV = nRT.
  • Its molar volume here is 22.414 L/mol (an ideal gas is 22.414 L/mol at 0 °C and 1 atm).

Next stepSwitch the "Solve for" dropdown to find any of pressure, volume, amount or temperature from the other three.

Formula

PV=nRT    n=PVRT,  P=nRTV,  V=nRTP,  T=PVnR,R=0.082057L⋅atmmol⋅KPV = nRT \;\Rightarrow\; n = \dfrac{PV}{RT},\; P = \dfrac{nRT}{V},\; V = \dfrac{nRT}{P},\; T = \dfrac{PV}{nR},\quad R = 0.082057\,\tfrac{\text{L·atm}}{\text{mol·K}}

Worked example

1 atm, 22.4 L, 0 °C (273.15 K): n = (1 × 22.4) ÷ (0.082057 × 273.15) ≈ 1.00 mol, about 6.022 × 10²³ molecules and a molar volume of 22.4 L/mol.

How the Calculation Works

The calculator solves PV = nRT for the number of moles, n = PV/(RT). Pressure is entered in atmospheres, volume in liters, and temperature in Celsius or Kelvin, the calculator converts Celsius to Kelvin automatically by adding 273.15. The universal gas constant R is fixed at 0.082057 L·atm·mol⁻¹·K⁻¹, which is the value defined for pressure in atm and volume in liters.

How to Use This Calculator

Enter the absolute pressure of the gas sample in atmospheres, the volume of the container in liters, and the temperature. If you measure temperature in Celsius, the calculator handles the conversion to Kelvin, never enter a raw Celsius value into the formula manually. The result, n, is the number of moles of gas present in your sample.

What Affects the Result

All three inputs, pressure, volume, and temperature, have a direct and proportional effect on the calculated moles. Doubling the pressure or volume doubles n, while doubling the absolute temperature (in Kelvin) halves n. Small errors in temperature measurement are especially consequential near absolute zero, where the Kelvin value is small and percentage errors are large.

Limitations of the Ideal Gas Law

The ideal gas law assumes gas molecules have no volume and exert no intermolecular forces, assumptions that break down at high pressures and low temperatures. Real gases deviate most strongly near their liquefaction point, where attractions between molecules become significant. For conditions close to standard temperature and pressure (273 K, 1 atm), the ideal gas law is accurate to within a fraction of a percent for most common gases.

Gas constant R and handy reference values

QuantityValueUnits
R (atm units)0.082057L·atm·mol⁻¹·K⁻¹
R (SI units)8.31446J·mol⁻¹·K⁻¹
Molar volume at STP (0 °C, 1 atm)22.414L/mol
Molar volume at SATP (25 °C, 1 bar)24.790L/mol
Avogadro’s number6.02214 × 10²³molecules/mol
1 atm101.325 kPa = 760 mmHg= 14.696 psi

Use the value of R that matches your units; this tool works internally in atm, L and K.

Frequently asked questions

What value of R should I use for this calculator?

This calculator uses R = 0.082057 L·atm·mol⁻¹·K⁻¹, which is the correct value when pressure is expressed in atmospheres and volume in liters. If you use SI units (pressure in pascals, volume in cubic meters), R becomes 8.31446 J·mol⁻¹·K⁻¹, the units of R must always match your input units.

Why does temperature have to be in Kelvin?

The ideal gas law is derived from thermodynamic principles where temperature represents the absolute kinetic energy of gas molecules. The Kelvin scale starts at absolute zero, the point of minimum thermal energy, so it is the only scale that produces physically meaningful and mathematically correct results in PV = nRT. Using Celsius or Fahrenheit directly would yield a negative or nonsensical answer at typical lab temperatures.

When does the ideal gas law give inaccurate results?

Accuracy decreases at high pressures (above roughly 10 atm) and low temperatures approaching a gas's boiling point, where intermolecular attractions and molecular volume become significant. Under these conditions, equations of state such as the van der Waals equation provide better predictions. For most laboratory work near ambient conditions, the ideal gas law introduces less than 1% error for gases like nitrogen, oxygen, and helium.

Sources

Written by Dr. Sofia Marchetti, PhD Chemist · Milan, Italy

Physical chemist and laboratory educator bringing rigorous solution science to accessible, accurate online tools.

Search 3,500+ calculators

Loading search…