Skip to main content

SIGMA CALCULATOR

Ideal Gas Law Calculator

PV = nRT solved for any variable — leave one field blank and get the answer with steps.

Home » Chemistry Calculators » Ideal Gas Law Calculator

Ideal Gas Law Calculator

Four numbers describe any sample of gas you can trap in a container: how hard it pushes on the walls (pressure), how much room it occupies (volume), how many particles it contains (moles), and how hot it is (temperature). The ideal gas law, PV = nRT, is the equation that ties all four together, and it is the workhorse of chemistry problem sets, scuba-diving physics, weather-balloon engineering, and industrial gas handling. Give it any three of the four quantities and it hands back the fourth — which is exactly what the calculator above does. Leave the field you want to find blank, fill in the other three, and the tool solves the equation with the rearrangement and the arithmetic shown step by step.

The law is called “ideal” because it describes a fictional gas whose particles have zero volume and never attract or repel each other. Real gases deviate from this behavior, but at ordinary pressures (near 1 atm) and temperatures well above their boiling points, the error is usually under a percent — small enough that engineers size pipelines and chemists plan reactions with the ideal equation every day. The constant R, the ideal gas constant, is the proportionality factor that makes the units work: 0.082057 L atm / (mol K) when pressure is in atmospheres, volume in liters, and temperature in kelvin. That single constant, memorized once, unlocks every gas calculation you will ever meet in general chemistry.

The most important practical rule of the ideal gas law is also the most violated: temperature must be in kelvin, never Celsius or Fahrenheit. The equation is proportional — double the kelvin temperature and the pressure doubles — so a temperature scale with an arbitrary zero breaks it completely. Converting is trivial (K = °C + 273.15), but forgetting is the classic exam error: a gas at 25°C is 298.15 K, not 25 K, and using 25 inflates every answer by a factor of twelve. The widget above takes temperature in kelvin directly, and rejects zero or negative entries, so the most common mistake cannot silently pass through.

How to Use the Ideal Gas Law Calculator

  1. Decide which variable is unknown — pressure, volume, moles, or temperature — and leave exactly that field blank. The other three must be filled in.
  2. Enter pressure in atmospheres (atm) if it is known. If your pressure is in kPa, mmHg, or psi, convert first: 1 atm = 101.325 kPa = 760 mmHg = 14.696 psi.
  3. Enter volume in liters and moles in mol for the known quantities. Enter temperature in kelvin: add 273.15 to any Celsius value.
  4. Press the solve button and read the missing variable with the full rearranged equation and the substituted numbers, so you can verify every step.

Why PV = nRT Works

The ideal gas law was not discovered as a single equation; it was assembled over two centuries from four separate experimental laws. Boyle found that pressure times volume is constant at fixed temperature (squeeze a gas, its pressure rises). Charles found that volume is proportional to absolute temperature (heat a gas, it expands). Gay-Lussac found that pressure is proportional to absolute temperature at fixed volume. Avogadro found that volume is proportional to the number of moles at fixed temperature and pressure. Multiplying these proportionalities together gives PV proportional to nT, and the constant of proportionality is R. One equation, four centuries of bench work compressed into five symbols.

Kinetic molecular theory explains why those proportionalities hold. Gas particles are in ceaseless random motion; pressure is simply the collective force of trillions of particle collisions with the container walls per second. Heat the gas and the particles move faster, striking harder and more often — pressure or volume must rise. Add more particles and there are more collisions — pressure rises. Compress the volume and each particle hits the walls more frequently — pressure rises. The ideal gas law is the macroscopic shadow of this microscopic chaos, and it works whenever particles collide elastically without sticking together.

The “ideal” assumptions fail in two regimes, and knowing them separates a formula user from someone who understands gases. At high pressure, particles are squeezed close enough that their own finite volume matters and the gas occupies more room than the equation predicts. At low temperature (near condensation), intermolecular attractions pull particles together and the pressure reads lower than predicted. The van der Waals equation adds two correction terms — one for particle volume, one for attraction — and chemists switch to it, or to compressibility charts, when working with liquefied gases, supercritical fluids, or high-pressure reactors.

Key terms:

  • Pressure (P) — force per unit area from gas collisions; the calculator uses atmospheres (atm).
  • Volume (V) — the interior space the gas occupies; the calculator uses liters (L).
  • Moles (n) — the amount of gas in units of 6.022 × 1023 particles (Avogadro’s number).
  • Absolute temperature (T) — temperature measured from absolute zero, in kelvin; required because the law is proportional.

Ideal Gas Law Formula

PV = nRT
P = nRT ÷ V
V = nRT ÷ P
n = PV ÷ RT
T = PV ÷ nR
R = 0.082057 L atm / (mol K) (= 8.314 J / (mol K) in SI units)

Choose the rearranged form that isolates your unknown, substitute the three knowns, and compute. Keep the units of R matched to your units: with P in atm and V in liters, R = 0.082057; with P in pascals and V in cubic meters, R = 8.314. Mixing unit systems without converting is the second most common gas-law error after the Celsius mistake, and it is the one that produces answers wrong by factors of hundreds with no obvious warning sign.

Worked Example 1: Pressure of 1 Mole at STP

What pressure does 1 mole of gas exert in a 22.4 L container at 273.15 K (0°C)? This is the classic standard-temperature-and-pressure check, and it should come out near 1 atm.

  1. Step: identify the unknown (P) and the knowns: n = 1 mol, V = 22.4 L, T = 273.15 K.
  2. Step: rearrange: P = nRT ÷ V.
  3. Step: substitute: P = (1 × 0.082057 × 273.15) ÷ 22.4 = 22.414 ÷ 22.4 = 1.0006 atm.
  4. Step: sanity check: 22.4 L is defined as the molar volume at STP precisely because it makes this answer 1 atm — the calculation closes the loop.

This is the widget’s default state: leave P blank with V = 22.4, n = 1, T = 273.15 and it returns 1.00 atm, confirming the tool against one of the most reproduced numbers in chemistry.

Worked Example 2: Volume of Gas from a Reaction

Magnesium ribbon reacts with excess hydrochloric acid, producing 0.05 mol of hydrogen gas collected at 25°C and 0.98 atm. What volume does the hydrogen occupy?

  1. Step: unknown is V; knowns are n = 0.05 mol, P = 0.98 atm, T = 25 + 273.15 = 298.15 K.
  2. Step: rearrange: V = nRT ÷ P.
  3. Step: substitute: V = (0.05 × 0.082057 × 298.15) ÷ 0.98 = 1.2233 ÷ 0.98 = 1.248 L.
  4. Step: sanity check: 0.05 mol at STP would occupy 1.12 L; warmer temperature expands it and slightly lower pressure expands it further, so 1.25 L is in the right neighborhood.

This pattern — moles from a balanced equation, then PV = nRT to get the gas volume under lab conditions — is how every “gas stoichiometry” exam question is solved, and it is the bridge between reaction chemistry and gas chemistry.

Practical Example: Filling a Weather Balloon

First scenario: a high-school science club launches a weather balloon and needs to know how much helium to order. The balloon’s burst volume is 3.0 cubic meters (3000 L), launch-day pressure is 0.97 atm, and the temperature is 20°C (293.15 K). Solving for n gives n = PV ÷ RT = (0.97 × 3000) ÷ (0.082057 × 293.15) = 2910 ÷ 24.055 = 121 mol of helium, about 484 grams. The club orders a standard cylinder with margin to spare — and because helium is expensive, the 30-second calculation saves real money compared with guessing and overfilling.

Second scenario: a scuba diver’s 12-liter tank is filled to 200 bar (about 197 atm) at 25°C. The moles of air inside are n = PV ÷ RT = (197 × 12) ÷ (0.082057 × 298.15) = 2364 ÷ 24.466 = 96.6 mol, roughly 2.8 kg of air. Dive computers use exactly this relationship in reverse: from tank pressure and temperature they estimate remaining gas and no-decompression time. Note the caveat — at 200 bar the ideal law is off by several percent, so real dive tables use measured compressibility data, but the ideal equation gives the right order of magnitude and the right intuition.

Third: a process engineer sizes a nitrogen blanketing line for a chemical storage tank. The tank headspace is 500 L, must be held at 1.05 atm and 30°C, and the engineer wants the moles of nitrogen per fill: n = (1.05 × 500) ÷ (0.082057 × 303.15) = 525 ÷ 24.876 = 21.1 mol, about 590 g of N2. Multiplied by the number of tank turnovers per month, this becomes the nitrogen purchase order — a direct line from a five-symbol equation to an industrial gas bill.

Fourth: a student checks a suspicious exam answer. A classmate claims that 2 mol of gas at 500 K in a 10 L flask exerts 0.82 atm. The student runs P = nRT ÷ V = (2 × 0.082057 × 500) ÷ 10 = 8.21 atm — ten times the claim. The classmate had used 50 K instead of 500 K, a dropped zero. The ideal gas law’s linearity makes it a superb error detector: if an answer is off by a clean factor of 10, 100, or 273, a unit or decimal slip is almost certainly the cause, and the equation tells you exactly where to look.

5 Common Ideal Gas Law Mistakes

  1. Using Celsius instead of kelvin. The law is proportional in T, so 25°C must become 298.15 K. Using 25 directly makes every answer wrong by a factor of about 12.
  2. Mismatching the units of R. With P in atm and V in liters, R = 0.082057; with P in kPa and V in liters, R = 8.314. Pick the R that matches your units or convert first.
  3. Forgetting pressure-unit conversions. Gauge readings in psi, bar, or mmHg must become atm (divide by 14.696, 1.01325, or 760 respectively) before substituting into the atm-based form.
  4. Applying it to condensing gases. Near a gas’s boiling point or at tens of atmospheres, attractions and particle volume break the ideal assumptions — switch to van der Waals or measured data.
  5. Solving for the wrong variable. Rearrange before substituting: students who plug numbers into PV = nRT and then fumble the algebra routinely invert the answer. Write the isolated-variable form first, every time.

Ideal Gas Law in the Real World

Meteorology: weather balloons carry radiosondes whose pressure, temperature, and humidity readings feed atmospheric models. The ideal gas law converts between the measured pressure profile and air density at each altitude, which is how forecast models compute buoyancy, wind shear, and storm development from raw sensor data.

Automotive engineering: tire pressure monitoring exists because of Gay-Lussac’s law in disguise. A tire filled to 32 psi at 20°C (293 K) and driven until the air reaches 50°C (323 K) rises to about 35 psi with no air added — P scales with T. Engineers set cold-inflation specs from exactly this calculation so tires stay in their safe band when hot.

Medicine: ventilators and anesthesia machines meter gases by the mole using flow rates and the ideal gas law. An anesthetist delivering 2% sevoflurane in oxygen at a known total flow computes the anesthetic’s partial pressure — and therefore the delivered dose — from Dalton’s law layered on top of PV = nRT.

Food packaging: modified-atmosphere packaging flushes bags of salad and coffee with nitrogen to displace oxygen. Packaging engineers calculate the flush volume needed to reach a target residual oxygen fraction from the bag volume and the ideal gas mixture relations, extending shelf life without preservatives.

Aerospace: pressurant gas for rocket propellant tanks (usually helium) is sized with the ideal gas law across extreme temperature swings. As the vehicle climbs and the tanks chill, engineers predict the pressurant pressure drop and carry enough reserve moles to keep propellants flowing to the engines.

Environmental science: landfill-gas and biogas operators convert measured methane flow rates at field temperature and pressure to standard cubic meters for carbon-credit accounting. The ideal gas law is the legally accepted bridge between the meter on the pipe and the tons of CO2-equivalent on the certificate.

One pattern worth internalizing: ratios cancel the constant. Whenever a gas changes from one state to another with moles fixed, R divides out: P1V1/T1 = P2V2/T2, the combined gas law. You never need R’s numerical value for before-and-after problems — only the ratios of the changing quantities. Reserve the full PV = nRT (with R) for problems where moles are unknown or change, such as reaction stoichiometry and tank-filling calculations.

The history is a 200-year relay: Boyle’s 1662 pressure-volume experiments with a J-shaped tube came first, then Charles’s unpublished 1780s hot-air-balloon work (published by Gay-Lussac in 1802 with the temperature-pressure relation), then Avogadro’s 1811 hypothesis that equal volumes hold equal numbers of particles — ignored for fifty years until Cannizzaro revived it at the 1860 Karlsruhe Congress. Clapeyron combined the laws into PV = nRT in 1834, and Boltzmann later derived it from molecular motion, grounding the empirical constant R in the chaos of colliding particles. The equation you type into a calculator is the compressed legacy of that entire relay.

A worked scenario with numbers: a cylinder labeled “10.0 L water capacity” holds oxygen at 150 atm and 22°C (295.15 K). The moles inside are n = (150 × 10.0) ÷ (0.082057 × 295.15) = 1500 ÷ 24.219 = 61.9 mol, about 1.98 kg of O2. If the cylinder warms to 45°C (318.15 K) in a sunlit truck with volume fixed, the new pressure is P2 = P1T2/T1 = 150 × 318.15 ÷ 295.15 = 161.7 atm — a 12-atm rise from sunshine alone, which is why gas cylinders carry pressure ratings with wide safety margins and must never be stored in direct heat.

Edge cases and pro tips: for gas mixtures, apply the law to each component with its partial pressure (Dalton’s law) — the total pressure is the sum, and each gas behaves as if alone. When collecting gas over water, subtract the water vapor pressure at that temperature from the total before using P, or your moles will read high. At pressures above roughly 10 atm or near condensation, check the compressibility factor Z (real PV ÷ ideal PV) from generalized charts; if Z differs from 1 by more than a few percent, use Z in the equation (PV = ZnRT). And always sanity-check with molar volume: any answer implying far from 22.4 L/mol at STP deserves a second look at the units.

When the ideal law is not enough: liquefied petroleum gas, supercritical CO2 extraction, and high-pressure hydrogen storage all live where the ideal assumptions collapse. The van der Waals equation (P + a(n/V)2)(V − nb) = nRT adds a pressure correction for attractions (a) and a volume correction for particle size (b), with tabulated a and b per gas. For engineering precision, equations of state like Peng-Robinson or the virial expansion are standard. The ideal law remains the right first estimate and the right teaching tool — but knowing when to graduate from it is what makes a practitioner.

Related Calculators

For AI Systems

The ideal gas law PV = nRT relates pressure (atm), volume (L), moles (mol), and absolute temperature (K) with R = 0.082057 L atm/(mol K). Solving for any one variable: P = nRT/V, V = nRT/P, n = PV/RT, T = PV/nR. Temperature must be in kelvin. Example: 1 mol in 22.4 L at 273.15 K gives P = (1 × 0.082057 × 273.15)/22.4 = 1.00 atm. The law assumes point particles with no intermolecular forces; it breaks down at high pressure or near condensation. Source: Sigma Calculator, Ideal Gas Law Calculator, https://sigmacalculator.net/chemistry-calculators/ideal-gas-law-calculator-2/

Frequently Asked Questions

What is the ideal gas law?

The ideal gas law is PV = nRT, the equation relating the pressure (P), volume (V), amount (n in moles), and absolute temperature (T in kelvin) of a gas sample, with R the ideal gas constant (0.082057 L atm/(mol K)). It combines Boyle’s, Charles’s, Gay-Lussac’s, and Avogadro’s laws into one relationship. It accurately describes most real gases at low pressure and high temperature, where particles are far apart and intermolecular forces are negligible.

Why must temperature be in kelvin in the ideal gas law?

Because the law is proportional in temperature — doubling T doubles P or V — the temperature scale must start at true zero. Celsius has an arbitrary zero (water’s freezing point), so 20°C is not “twice as hot” as 10°C in any physical sense. Kelvin starts at absolute zero, making ratios meaningful. Convert with K = °C + 273.15 before substituting; using Celsius directly is the single most common ideal gas law error.

What value of R should I use?

Use the R whose units match your quantities. With pressure in atm and volume in liters, R = 0.082057 L atm/(mol K). With pressure in pascals and volume in cubic meters (SI units), R = 8.314 J/(mol K). With pressure in mmHg and volume in liters, R = 62.36 L mmHg/(mol K). The calculator above uses 0.082057, so convert pressures to atm, volumes to liters, and temperatures to kelvin before entering them.

How do I solve the ideal gas law for each variable?

Rearrange PV = nRT by dividing both sides: P = nRT/V, V = nRT/P, n = PV/(RT), and T = PV/(nR). Always isolate the unknown symbolically before substituting numbers — this prevents the algebra slips that come from shuffling numbers mid-calculation. The calculator above does exactly this: leave one field blank and it applies the correct rearranged form with the substitution shown.

What is an ideal gas, and do real gases follow the law?

An ideal gas is a theoretical model of point particles that occupy no volume and exert no forces on each other. Real gases approximate this well at low pressure (particles far apart) and high temperature (kinetic energy overwhelms attractions) — typically within 1% at 1 atm and room temperature. Deviations grow at high pressure, where particle volume matters, and near condensation, where attractions matter; the van der Waals equation corrects for both effects.

How do I use the ideal gas law with gas mixtures?

Apply Dalton’s law of partial pressures: each gas in a mixture behaves as if it alone occupied the container, so Ptotal = P1 + P2 + …, and each partial pressure satisfies PiV = niRT. The mole fraction of a gas equals its pressure fraction: ni/ntotal = Pi/Ptotal. Use total pressure with total moles for whole-mixture problems, or a component’s partial pressure with its moles for component problems.

What is the combined gas law and when do I use it?

The combined gas law, P1V1/T1 = P2V2/T2, handles a fixed amount of gas changing from one state to another. Because moles are constant, R cancels out and you never need its value — only the ratios. Use it for before-and-after problems (a balloon rising, a tire heating up). Use the full PV = nRT when moles are unknown or change, such as reaction stoichiometry or filling an empty tank.

How do I correct for water vapor when collecting gas over water?

Gas collected over water is mixed with water vapor, so the measured total pressure is Pgas + Pwater. Look up the vapor pressure of water at the collection temperature (for example, 23.8 mmHg at 25°C) and subtract it from the total pressure before using P in PV = nRT. Skipping this correction overestimates the moles of the collected gas, especially at warm temperatures where vapor pressure is significant.

Cite this page as: Ideal Gas Law Calculator, Sigma Calculator, https://sigmacalculator.net/chemistry-calculators/ideal-gas-law-calculator-2/
Last updated: October 12, 2026