Home › Math & Science › Ideal Gas Law Calculator

Ideal Gas Law Calculator

A gas problem always hands you three facts and asks for a fourth — the pressure in a sealed tank, the volume a mole of gas takes up, the temperature behind a gauge reading. This free ideal gas law calculator solves PV = nRT in all four directions, with pressure in atm, kPa, bar or mmHg, volume in liters or milliliters, and temperature entered in kelvin, Celsius or Fahrenheit.

Pressure = 1.000 atm
P = nRT/V = 1 × 0.082057 × 273.15 / 22.414
Pressure1.000 atm
Volume22.414 L
Moles1 mol
Temperature273.15 K

How it works

The ideal gas law squeezes three older gas laws — Boyle's, Charles's and Avogadro's — into a single equation that describes a gas whose molecules are too far apart to interfere with each other. Almost every gas you meet in a classroom, a scuba tank or a weather balloon behaves closely enough to it.

PV = nRT   •   P = nRT ÷ V   •   V = nRT ÷ P   •   n = PV ÷ (RT)   •   T = PV ÷ (nR)

Pressure (P) is how hard the gas pushes on its container. Enter it in atmospheres, kilopascals, bar or mmHg; the calculator converts to atm internally (1 atm = 101.325 kPa = 1.01325 bar = 760 mmHg). Volume (V) is the space the gas fills, in liters or milliliters. Moles (n) is the amount of gas — one mole is 6.022 × 10²³ molecules, and for a gas like oxygen (O₂, 32 g/mol), 32 grams is one mole. Temperature (T) must be absolute: the formula runs in kelvin, so Celsius entries get 273.15 added and Fahrenheit entries are converted first. R, the gas constant, is 0.082057 L·atm/(mol·K) in the units used here.

Notice what the equation says about the world. Squeeze a gas into half the volume at the same temperature and the pressure doubles. Heat a sealed, rigid tank and the pressure climbs in direct proportion to the kelvin temperature — which is why spray cans carry "do not incinerate" warnings and why tire pressures rise after a highway drive.

Worked example

A rigid cylinder holds 2 moles of nitrogen at 300 K in a volume of 10 liters. What pressure is inside?

Step 1 — write the rearranged formula: P = nRT ÷ V.
Step 2 — substitute: P = 2 × 0.082057 × 300 ÷ 10.
Step 3 — multiply the top line: 2 × 0.082057 × 300 = 49.2342.
Step 4 — divide by the volume: 49.2342 ÷ 10 = 4.923 atm (about 498.9 kPa).

Set the calculator to solve for pressure and enter 2 moles, 300 K and 10 L: it returns 4.923 atm, with the table showing the same pressure in the other units. The defaults loaded in the box are the classic check of the whole law — 1 mole at 273.15 K in 22.414 L gives exactly 1.000 atm.

Common mistakes

Using Celsius or Fahrenheit directly. A gas at 27 °C is at 300.15 K, not 27 of anything the formula understands. Entering 27 makes the answer about eleven times too small. Either pick the °C or °F option next to the temperature box — the conversion is done for you — or add 273.15 yourself.

Mixing pressure units mid-problem. A gauge reading of 200 kPa is about 1.97 atm, not 200 atm. The constant R used here is built for atmospheres and liters, so every pressure must arrive as atm before the math — the unit menu handles that, but a hand calculation has to do it explicitly.

Expecting accuracy at extreme conditions. Inside a nearly-full LPG cylinder or just above a gas's boiling point, molecules crowd and attract, and the ideal answer can be off by several percent. For those cases engineers use real-gas corrections; for everything at ordinary pressures and temperatures, this law is the right tool.

FAQ

What is the ideal gas law?

The ideal gas law is PV = nRT. It links a gas's pressure (P), volume (V), amount in moles (n) and temperature (T) through one equation, with R the gas constant. If you know any three of the four quantities, the fourth follows: P = nRT/V, V = nRT/P, n = PV/RT and T = PV/nR — all four rearrangements are built into the calculator above.

What value of R does this calculator use?

R = 0.082057 L·atm/(mol·K), the form of the gas constant that pairs with liters, atmospheres, moles and kelvin — the units this calculator works in internally. The same constant in SI units is 8.314 J/(mol·K), which pairs pascals with cubic meters. Both describe the same constant; only the unit system changes.

Why does the temperature have to be in kelvin?

Because the gas law is built on absolute temperature, where zero means no thermal motion at all. The kelvin scale starts at that absolute zero, so ratios work out correctly: doubling the kelvin temperature at fixed volume really does double the pressure. Celsius and Fahrenheit have arbitrary zero points, so plugging them in directly gives nonsense. This calculator converts °C and °F entries to kelvin for you.

What is the molar volume of a gas at STP?

One mole of an ideal gas at 273.15 K (0 °C) and 1 atm pressure occupies 22.414 liters. Try it above: solve for pressure with 1 mole, 273.15 K and 22.414 L and you get 1.000 atm. This 22.414 L figure is the classic molar volume taught in most chemistry courses.

When does the ideal gas law break down?

The law treats gas molecules as point particles that never attract each other. That is a good approximation at low pressure and high temperature, where molecules are far apart. It drifts at high pressures, near the temperature where the gas starts to condense, and for large polar molecules — there, real-gas equations such as van der Waals give better answers. For classroom and everyday conditions, the ideal law is usually within a percent or two.

Disclaimer: Results are for education and general use. Check important calculations independently before relying on them for exams, work, or decisions where accuracy matters.