Boneyard Tools

Ideal Gas Law Calculator

Enter any three of pressure, volume, moles and temperature, and this calculator solves PV = nRT for the fourth. Pick the unknown with the 'Solve for' menu, choose units for each row, and the values are converted to atm, litres and kelvin internally before the answer is converted back. It uses R = 0.082057 L atm per mol per kelvin and rounds results to six decimal places.

How to use the ideal gas law calculator

  1. Open the 'Solve for' menu and pick the unknown: Pressure (P), Volume (V), Moles (n) or Temperature (T).
  2. Set the unit dropdowns you need: pressure in atm or kPa, volume in L or m3, temperature in K or C.
  3. Type values into the other three rows. The row marked (unknown) is disabled and left blank.
  4. Read the four result cards, where the solved quantity is highlighted in the panel below.
  5. Click Copy to grab all four values as P, V, n and T lines.

Examples

Molar volume at STP (solve for volume)

Solve V, n = 1 mol, T = 273.15 K, P = 1 atm
V = 22.41387 L

Pressure of a compressed gas (solve for pressure)

Solve P, n = 2 mol, V = 10 L, T = 300 K
P = 4.92342 atm

Gas volume at room temperature in Celsius (solve for volume)

Solve V, n = 1 mol, P = 1 atm, T = 25 C
V = 24.465295 L

Frequently asked questions

What is the ideal gas law?

The ideal gas law is PV = nRT. It links the pressure, volume, amount in moles and absolute temperature of a gas through the gas constant R, treating the gas as ideal.

What value of R does this use?

It uses R = 0.082057 L atm per mol per kelvin. Because R is fixed in those units, any pressure in kPa, volume in m3 or temperature in Celsius is converted to atm, litres and kelvin before solving, then converted back for display.

How many values do I need to enter?

Exactly three of the four. From any three of pressure, volume, moles and temperature the fourth is fully determined. The 'Solve for' menu marks which one is the unknown, and that row is disabled.

Why must temperature be absolute?

PV = nRT is only valid on an absolute scale where zero means zero thermal energy. Celsius inputs are converted to kelvin by adding 273.15, so 0 C becomes 273.15 K. Entering a temperature at or below absolute zero is rejected.

What units can I mix and match?

Pressure in atm or kPa, volume in litres or cubic metres (m3), and temperature in kelvin or Celsius. Moles are always in mol. Each row has its own unit dropdown, so you can enter kPa and Celsius together, for example.

How precise are the answers?

Every result is rounded to six decimal places. That is why molar volume at STP reads 22.41387 L rather than an exact 22.414, since the underlying value carries more digits before rounding.

Does it work for real gases?

It assumes ideal behaviour, which is a close fit for many gases near room temperature and moderate pressure. Accuracy drops at high pressure or low temperature, where intermolecular forces and molecular volume matter and an equation like van der Waals fits better.

What if I enter a zero or negative value?

Pressure, volume and moles must be greater than zero and temperature must be above absolute zero, so the calculator flags any zero or negative entry rather than returning a nonsense answer.

Is my input sent anywhere?

No. The calculation runs entirely in your browser with no server round trip, so the numbers you type never leave your device.

Learn more

Related tools