Skip to main content

Ideal Gas Law Calculator

I built this to skip the unit-conversion busywork of PV = nRT problems — enter any three of pressure, volume, moles, and temperature in whatever units you have, and get the fourth instantly.

Quick Answer

The ideal gas law is PV = nRT, where P is pressure (atm), V is volume (L), n is moles, R is 0.0821 L·atm/(mol·K), and T is temperature in kelvin.

Enter any three of the four values above — in atm, kPa, psi, L, ft³, K, °C, or °F — to solve for the fourth.

Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, moles, or temperature.

Try:

About the Ideal Gas Law

How This Calculator Works

The ideal gas law, PV = nRT, relates pressure, volume, moles, and temperature for an ideal gas. Pick which value you need, enter the other three in any unit, and this tool converts everything to atm, liters, and kelvin internally before solving.

Where the Constant R Comes From

R is the universal gas constant, equal to 0.0821 L·atm/(mol·K) or 8.314 J/(mol·K) in SI units. It links the macroscopic PV = nRT equation to the microscopic kinetic theory of gases, and its value is fixed by the Boltzmann constant and Avogadro's number.

When the Ideal Gas Law Breaks Down

This model assumes gas molecules take up no volume and never attract or repel each other — a good approximation at normal pressures and temperatures, but less accurate at very high pressure or near a gas's condensation point, where the Van der Waals equation gives better results.

What Is the Ideal Gas Law and How Do You Calculate It?

The ideal gas law is the equation of state PV = nRT that relates a gas's pressure, volume, amount, and temperature under the assumption it behaves as an ideal gas — one whose molecules have negligible volume and exert no intermolecular forces. It combines Boyle's, Charles's, and Avogadro's laws into a single equation, first stated in this form by Émile Clapeyron in 1834.

In the formula, P is pressure (atmospheres), V is volume (liters), n is the amount of gas (moles), R is the universal gas constant — 0.0821 L·atm/(mol·K), or 8.314 J/(mol·K) in SI units — and T is absolute temperature (kelvin). Given any three of the four quantities, the ideal gas law solves for the fourth.

At standard temperature and pressure (STP: 0°C and 1 atm), one mole of an ideal gas occupies 22.4 liters — a constant used throughout general chemistry to convert between moles and gas volume without weighing a sample.

How to Use This Ideal Gas Law Calculator

Choose which quantity you want to solve for, then enter the other three values in whatever units you have on hand — the calculator converts everything to atmospheres, liters, and kelvin before applying PV = nRT.

  • Pressure: Accepts atm, kPa, mmHg (torr), psi, or bar — useful whether you're working from a US gauge in psi or a lab manometer in mmHg.
  • Volume: Accepts liters, milliliters, cubic meters, or cubic feet, covering both lab glassware and industrial tank sizes.
  • Amount of Gas (n): The number of moles of gas present — convert from grams using the substance's molar mass first if you only know mass.
  • Temperature: Accepts kelvin, Celsius, or Fahrenheit. The calculator converts to kelvin internally since the ideal gas law requires an absolute temperature scale.

This calculator works with metric units common in chemistry labs (atm, L, °C) and US customary units common in engineering contexts (psi, ft³, °F) side by side, so results are useful whether you're a student solving a textbook problem or an engineer sizing a compressed-gas system.

How Do the Individual Gas Laws Compare?

The ideal gas law is a combination of four simpler laws, each of which holds two of the four variables constant. The table below shows how each relates to PV = nRT.

LawFormulaHeld ConstantDiscovered
Boyle's LawP₁V₁ = P₂V₂Temperature, molesRobert Boyle, 1662
Charles's LawV₁/T₁ = V₂/T₂Pressure, molesJacques Charles, 1787
Gay-Lussac's LawP₁/T₁ = P₂/T₂Volume, molesJoseph Gay-Lussac, 1808
Avogadro's LawV₁/n₁ = V₂/n₂Pressure, temperatureAmedeo Avogadro, 1811

According to the National Institute of Standards and Technology (NIST), the universal gas constant R has a fixed value of 8.31446 J/(mol·K), derived from the Boltzmann constant and Avogadro's number — the same constant this calculator uses, expressed as 0.0821 L·atm/(mol·K) for the units chemists most often work in.

Frequently Asked Questions

What is a real-life example of the ideal gas law?

A car tire is a common example: as ambient temperature rises, the air inside expands and pressure increases even though the tire's volume barely changes — exactly what PV = nRT predicts when V and n are held roughly constant and T increases.

How accurate is this ideal gas law calculator?

This calculator applies PV = nRT exactly, which is highly accurate for gases at normal pressures and temperatures. According to the kinetic theory of gases, it becomes less accurate at high pressure or low temperature, where intermolecular forces and molecular volume — both ignored by the ideal model — start to matter; real gases are better modeled with the Van der Waals equation under those conditions.

What is the difference between the ideal gas law and Boyle's Law?

Boyle's Law is a special case of the ideal gas law that only applies when temperature and the amount of gas are held constant, leaving pressure and volume inversely proportional. The ideal gas law is the general equation that lets all four variables — pressure, volume, moles, and temperature — change at once.

What value of R should I use?

Use 0.0821 L·atm/(mol·K) when working in atmospheres and liters, 8.314 J/(mol·K) when working in SI pressure (pascals) and cubic meters, or 62.36 L·mmHg/(mol·K) when pressure is measured in millimeters of mercury. This calculator handles the unit conversion automatically regardless of which units you enter.

Related Calculators

Ohm's Law Calculator

Speed & Velocity Calculator

Force Calculator