MathIsimple
Ideal Gas Law Calculator

Ideal Gas Law Calculator

Calculate pressure, volume, temperature, or amount using PV = nRT. Perfect for chemistry and physics students.

100% FreeStep-by-Step SolutionsChemistry & Physics
Ideal Gas Law Formula
The fundamental equation relating pressure, volume, temperature, and amount of gas
PV=nRTPV = nRT
Solve for P
P=nRTVP = \frac{nRT}{V}
Solve for V
V=nRTPV = \frac{nRT}{P}
Solve for T
T=PVnRT = \frac{PV}{nR}
Solve for n
n=PVRTn = \frac{PV}{RT}
PV = nRT Calculator
Enter three variables to solve for the fourth
Gas Container Visualization
A closed container with gas molecules exerting pressure on all walls.
Pressure arrows on all wallsCyan dots = gas moleculesCenter marker = amount n

Pressure (P) arises from gas molecules colliding with container walls. Higher temperature or more moles increases collision frequency and thus pressure.

PV = nRT Relationship Diagrams
Three quick plots for the pairwise relationships when other variables are fixed.

Left plot: P decreases as V increases (inverse relation).

Middle plot: V increases linearly with T.

Right plot: P increases linearly with T.

Understanding the Ideal Gas Law

What Is the Ideal Gas Law?

The ideal gas law is one of the most fundamental equations in chemistry and physics. Written asPV=nRTPV = nRT, it describes the state of a hypothetical “ideal gas” — a gas whose molecules occupy no volume and exert no intermolecular forces on one another. Despite being a simplification, the ideal gas law is remarkably accurate for most common gases at moderate temperatures and pressures.

The equation was first stated in its complete form in 1834 by Benoît Paul Émile Clapeyron, who unified earlier empirical gas laws into a single relationship. Each variable in the equation has a specific physical meaning:

  • P — Absolute pressure of the gas (in Pascals, Pa)
  • V — Volume of the gas sample (in cubic metres, m³)
  • n — Amount of substance of gas (in moles, mol)
  • R — The universal gas constant
  • T — Absolute temperature (in Kelvin, K)

The law tells us that if you know any three of these four variables (P, V, n, T), you can calculate the fourth. This makes it an indispensable tool for chemists, physicists, engineers, and students across many disciplines.

The Gas Constant R and Its Units

The universal gas constant RR is a physical constant that relates energy to temperature and amount of substance. Its value is precisely defined as:

R=8.314462618 J mol1K1R = 8.314\,462\,618\ldots\ \text{J mol}^{-1}\text{K}^{-1}

Depending on the units you use for pressure and volume, R takes different numerical values:

Value of RUnitsCommon use
8.314J/(mol·K)SI standard, physics, engineering
0.08206L·atm/(mol·K)General chemistry courses
62.36L·mmHg/(mol·K)Lab settings using mmHg/torr
8314L·Pa/(mol·K)SI with litres for volume

Always match your choice of R to the units you use for P and V. Using mismatched units is one of the most common sources of error in gas law calculations.

Boyle’s, Charles’s, and Gay-Lussac’s Laws as Special Cases

The ideal gas law unifies three earlier empirical laws. Each one describes what happens when two variables are held constant:

Boyle’s Law (constant T and n)

At constant temperature and amount, pressure and volume are inversely proportional. Compressing a gas increases its pressure.

P1V1=P2V2P_1 V_1 = P_2 V_2

Derived from PV = nRT by holding n, R, T constant.

Charles’s Law (constant P and n)

At constant pressure and amount, volume is directly proportional to absolute temperature. Heating a gas causes it to expand.

V1T1=V2T2\frac{V_1}{T_1} = \frac{V_2}{T_2}

Derived from PV = nRT by holding n, R, P constant.

Gay-Lussac’s Law (constant V and n)

At constant volume and amount, pressure is directly proportional to absolute temperature. This is why pressure cookers build up pressure when heated.

P1T1=P2T2\frac{P_1}{T_1} = \frac{P_2}{T_2}

Derived from PV = nRT by holding n, R, V constant.

Avogadro’s Law (constant P and T)

At constant pressure and temperature, volume is directly proportional to amount. Equal volumes of gases at the same conditions contain equal numbers of molecules.

V1n1=V2n2\frac{V_1}{n_1} = \frac{V_2}{n_2}

Derived from PV = nRT by holding P, R, T constant.

STP and SATP Standard Conditions

Chemists often quote gas properties at defined standard conditions to allow fair comparison. Three reference conditions are commonly used:

STP

Standard Temperature & Pressure
0 °C (273.15 K)
1 atm (101,325 Pa)
22.4 L/mol

NTP

Normal Temperature & Pressure
20 °C (293.15 K)
1 atm (101,325 Pa)
24.0 L/mol

SATP

Standard Ambient T & P
25 °C (298.15 K)
1 bar (100,000 Pa)
24.8 L/mol

Note that IUPAC redefined STP in 1982 to use 1 bar (100,000 Pa) rather than 1 atm. Some older textbooks still use the pre-1982 definition. Always check which standard your source is using.

Limitations: Real Gases vs. Ideal Gases

The ideal gas law assumes two things that are never exactly true: (1) gas molecules have zero volume, and (2) there are no intermolecular attractions or repulsions. Real gases deviate from this model most noticeably under:

  • High pressure — molecules are forced close together; their finite size becomes significant.
  • Low temperature — kinetic energy decreases, allowing intermolecular forces to matter more.
  • Polar or large molecules — gases like NH₃, CO₂, and SO₂ have stronger interactions.

For more accurate results in these regimes, chemists use the van der Waals equation:

(P+an2V2)(Vnb)=nRT\left(P + \frac{an^2}{V^2}\right)(V - nb) = nRT

where aa corrects for intermolecular attractions and bb corrects for molecular volume. However, for most introductory chemistry and engineering problems, the ideal gas law gives results accurate to within a few percent.

External Resources

Related Gas Laws

Boyle’s Law (Constant T, n)

P1V1=P2V2P_1V_1 = P_2V_2

Pressure inversely proportional to volume

Charles’s Law (Constant P, n)

V1T1=V2T2\frac{V_1}{T_1} = \frac{V_2}{T_2}

Volume directly proportional to temperature

Gay-Lussac’s Law (Constant V, n)

P1T1=P2T2\frac{P_1}{T_1} = \frac{P_2}{T_2}

Pressure directly proportional to temperature

Avogadro’s Law (Constant P, T)

V1n1=V2n2\frac{V_1}{n_1} = \frac{V_2}{n_2}

Volume directly proportional to amount

Real-World Applications

Laboratory Applications

  • • Gas collection and measurement experiments
  • • Calculating molecular weights of gases
  • • Determining gas densities
  • • Stoichiometric calculations in reactions

Industrial Applications

  • • HVAC system design and optimization
  • • Compressed gas storage calculations
  • • Chemical reactor design
  • • Pneumatic system pressure calculations

Environmental Science

  • • Atmospheric pressure and altitude relations
  • • Air pollution concentration calculations
  • • Greenhouse gas emission measurements
  • • Weather balloon calculations

Every November, the Same Warning Light

Every November, my tire pressure light comes on. Every single year. The tires aren't leaking — I checked. Twice. Took my Honda Civic to Discount Tire, and the guy behind the counter didn't even look at the car. "It's the cold," he said. "Happens to everyone."

He was right. And the reason fits in one equation.

When the temperature outside drops from a comfortable 80°F in September to 30°F in November, the air molecules inside your tires slow down. They hit the tire walls less often and with less force. The rubber doesn't shrink. The air doesn't escape. But the pressure drops — roughly 1 PSI for every 10°F decrease, according to the Tire Industry Association. A 50-degree swing means you've lost about 5 PSI without a single molecule leaving the tire.

That's not a rule of thumb someone made up. It falls straight out of the ideal gas law.

The Equation Behind Your TPMS Light

Before the formula, here's the situation in numbers. Say your tires were filled to 35 PSI on a warm September day at 80°F. November hits, and it's 30°F outside. The volume of the tire stays roughly the same — it's a rigid container. The amount of air (moles) hasn't changed either. Only the temperature moved.

First, convert to absolute temperature (Kelvin), because gas laws don't work with Fahrenheit or Celsius — they need a scale where zero means zero molecular motion.

Temperature Conversion

80°F=300 K30°F=272 K80°F = 300\text{ K} \quad | \quad 30°F = 272\text{ K}

Since volume and the amount of gas stay constant, pressure is directly proportional to temperature. That gives us:

P1T1=P2T2P2=P1×T2T1\frac{P_1}{T_1} = \frac{P_2}{T_2} \quad \Rightarrow \quad P_2 = P_1 \times \frac{T_2}{T_1}

Plug in the numbers:

P2=35×272300=35×0.907=31.7 PSIP_2 = 35 \times \frac{272}{300} = 35 \times 0.907 = 31.7 \text{ PSI}

You started at 35 PSI. Now you're at 31.7. That's a 3.3 PSI drop — enough to trigger the TPMS warning on most cars (which typically fires at 25% below the recommended pressure). And you didn't drive over a single nail.

Why Kelvin? Celsius and Fahrenheit have arbitrary zero points. Kelvin starts at absolute zero — the temperature where molecules stop moving entirely (−459.67°F). Gas pressure depends on molecular motion, so you need a scale that starts at "no motion." Using Celsius in gas law calculations gives nonsensical results.

PV = nRT — The Full Picture

The tire example used a simplified version. The full ideal gas law connects four variables at once: pressure, volume, temperature, and the amount of gas.

The Ideal Gas Law

PV=nRTPV = nRT

PP = pressure (in atm, PSI, or Pascals)

VV = volume (liters)

nn = moles of gas (amount of stuff)

RR = gas constant (0.0821 L·atm/mol·K)

TT = temperature (Kelvin — always Kelvin)

In plain English: pressure times volume equals the amount of gas times a constant times the temperature. If you lock down any three variables, the fourth is determined. That's it. One equation, four knobs.

The tire scenario locked volume and moles, so only pressure and temperature could change. That's actually a special case called Gay-Lussac's Law. Boyle's Law holds temperature constant and watches pressure and volume trade off. Charles's Law holds pressure constant and links volume to temperature. They're all just PV = nRT with different variables pinned down.

Boyle, Charles, and Gay-Lussac Walk Into a Lab

Before PV = nRT existed as one equation, three scientists discovered pieces of it independently:

LawRelationshipHeld ConstantReal-World Example
Boyle'sP ↑ → V ↓T, nSqueezing a syringe
Charles'sT ↑ → V ↑P, nHot air balloon rising
Gay-Lussac'sT ↑ → P ↑V, nTire pressure in winter

PV = nRT is just all three laws stitched together. Once you see it that way, the equation stops being abstract. It's a description of how gas molecules behave when you change their environment — squeeze them, heat them, add more of them, or give them more room.

Beyond Tires: Where PV = nRT Shows Up

Scuba diving. At 30 meters depth, the pressure is about 4 atmospheres. A lungful of air at that depth occupies ¼ of its surface volume (Boyle's Law). Rise too fast without exhaling and that air expands back to full size inside your lungs. That's how lung overexpansion injuries happen — and why every dive instructor drills "never hold your breath."

Cooking at altitude. In Denver (5,280 feet), atmospheric pressure is about 83% of sea level. Water boils at 202°F instead of 212°F. Your pasta takes longer. Your cake rises faster and then collapses. The ideal gas law explains why — lower external pressure means gas bubbles in the batter expand more easily.

The connection to density is direct: gas density depends on pressure and temperature. Hot air is less dense than cold air (same pressure, higher temperature, more volume per mole). That's why hot air balloons float and why warm air rises in your house.

When the "Ideal" Part Breaks Down

The ideal gas law assumes gas molecules are infinitely small points that don't attract each other. Real molecules have volume and do interact. At high pressures (molecules crammed together) or low temperatures (molecules moving slowly enough to "stick"), the ideal gas law starts giving wrong answers.

For everyday conditions — room temperature, atmospheric pressure, the air in your tires — PV = nRT is accurate within 1-2%. For industrial applications involving extreme conditions, engineers use the Van der Waals equation, which adds correction terms for molecular size and intermolecular forces.

But for your TPMS light? PV = nRT is more than good enough. And now you know why it comes on every November.

Frequently Asked Questions

What is the ideal gas law used for?

PV = nRT relates pressure, volume, temperature, and the amount of gas. It's used to predict how gases behave when conditions change — calculating tire pressure at different temperatures, determining gas volumes in chemical reactions, sizing storage tanks, and understanding atmospheric phenomena. It works well for most gases at everyday temperatures and pressures.

Why do tires lose pressure in cold weather?

Gas pressure is directly proportional to temperature (Gay-Lussac's Law). When temperature drops, air molecules move slower and exert less force on the tire walls. The rule of thumb: about 1 PSI lost for every 10°F drop. A 50°F temperature swing from summer to winter can cost you 5 PSI — enough to trigger your TPMS warning.

When does the ideal gas law not work?

At very high pressures (above ~10 atm) or very low temperatures (near a gas's boiling point), real gas behavior deviates significantly from the ideal model. The Van der Waals equation accounts for molecular volume and intermolecular attractions. For everyday conditions — room temperature, atmospheric pressure — PV = nRT is accurate within 1-2%.

Solve Any Gas Law Problem

Enter any three variables — pressure, volume, temperature, moles — and we'll find the fourth. Works for Boyle's, Charles's, and the full PV = nRT.

*Remember: always convert temperature to Kelvin first.

Frequently Asked Questions

What is the ideal gas law?
PV = nRT relates pressure (P), volume (V), moles (n), the universal gas constant (R), and temperature (T, in K). Valid for most real gases at moderate temperatures and pressures.
What is R and which value should I use?
R is the universal gas constant. Use R = 8.314 J/(mol·K) with Pa and m³. Use R = 0.0821 L·atm/(mol·K) with atm and L. Always match R to your units.
When does the ideal gas law break down?
At very high pressure or very low temperature, intermolecular forces and molecular volume matter. Use the van der Waals equation or other real-gas models.
How does PV = nRT relate to STP?
At STP (0 °C, 1 atm), 1 mole of an ideal gas occupies 22.4 L. Derived by plugging those values into PV = nRT.
How do I handle temperature unit conversion?
Always convert to Kelvin: K = °C + 273.15. The ideal gas law only works with absolute temperature.
Advertisement