Skip to main content

Free Ideal Gas Law Calculator – Solve PV = nRT Instantly

Solve PV = nRT for pressure, volume, moles or temperature, with the correct gas constant automatically matched to your chosen units and shown on screen.

Written & reviewed by Helperzy Editorial Team · Updated July 2026

PV = nRTAny Unit SystemMass ⇄ MolesDensitySTP VolumeCombined Gas LawFree

Using R = 0.0820573661 L·atm/(mol·K)

22.414 L

Solved from PV = nRT using R = 0.0820574 L·atm/(mol·K)

Molar Volume at STP — Two Definitions

22.414 L/mol

Traditional STP — 0 °C, 1 atm (used by this tool's primary result and most textbooks)

22.711 L/mol

IUPAC STP (1982–present) — 0 °C, 100 kPa (1 bar)

Why the Gas Constant Must Match Your Units

R is the same physical constant everywhere — the exact SI value is 8.31446261815324 J/(mol·K) (NIST/CODATA, exact since the 2019 redefinition of the mole) — but its numerical value changes when pressure and volume are expressed in different units. A tool that silently mixes an atm-based R with a Pa-based pressure will be wrong by a factor of over 100,000. That is why this calculator always shows which R it used.

When the Ideal Gas Approximation Breaks Down

Real gases deviate from PV = nRT at high pressure and low temperature, where the intermolecular attraction and the finite size of gas molecules — both ignored by the ideal gas law — start to matter. The van der Waals equation, (P + an²/V²)(V − nb) = nRT, corrects for both effects with two gas-specific constants a and b. As a rough guide, expect a few percent of error above roughly 10 atm, and much larger error as a gas approaches its critical point or condenses. This calculator always reports the ideal-gas answer; treat it as an approximation, not a lab-grade real-gas measurement.

100% Private

Every calculation runs in your browser. Nothing you type is uploaded anywhere.

How to Use Ideal Gas Law Calculator

1

Choose your unit system

Pick SI (Pa, m³), or one of the three chemistry conventions (atm, kPa or Torr, all with litres). The calculator immediately shows the exact gas constant R it will use for that unit system, so you know which value produced your answer.

2

Enter the three known values and pick what to solve for

Fill in pressure, volume, amount of gas in moles, and temperature (in °C, °F or K — it's converted to kelvin automatically), leaving the one you want to find. The calculator disables that field and computes it live as you type the others.

3

Read the result, and optionally add density or a second gas state

The solved value appears instantly with the formula and R value used. Turn on the density toggle and enter a chemical formula for mass, moles and density, or switch to Combined Gas Law mode to compare two different pressure-volume-temperature states of the same gas sample.

How the Ideal Gas Law Calculator Works

The ideal gas law, PV = nRT, ties together the four measurable properties of a gas sample: pressure (P), volume (V), the amount of gas in moles (n), and its absolute temperature (T). This calculator rearranges that single equation to solve for whichever one of the four you're missing, given the other three. It combines three older gas laws into one relationship: Boyle's law (pressure and volume are inversely related at constant temperature), Charles's law (volume grows with temperature at constant pressure), and Avogadro's law (volume grows with the amount of gas). Chemistry students use it to check lab results, HVAC and process engineers use it to size gas systems, and anyone curious about why a sealed bag of chips puffs up on a flight can use it to see the math behind that. The part almost every other gas-law calculator gets sloppy about is the gas constant R. R is one physical constant, but its numerical value changes depending on which pressure and volume units you plug into the equation, and using the wrong R with the wrong units is the single most common reason two calculators disagree on the same problem. This tool fixes that by tying R directly to your chosen unit system and displaying the exact value it used on screen, every time. Behind the scenes it starts from the exact SI value, R = 8.31446261815324 J per mole per kelvin — this number is now defined exactly rather than measured, because the 2019 redefinition of the SI base units fixed both the Boltzmann constant and Avogadro's number, and R is simply their product. From that one exact number, the tool derives R = 0.082057366 L·atm/(mol·K) for the atm-and-liters chemistry convention, R = 62.363598 L·Torr/(mol·K) for millimetres of mercury, and R = 8.314462618 L·kPa/(mol·K) for kilopascals — each derivation shown step by step in the calculator's research notes so you can reproduce it yourself with a hand calculator. To see the calculator in action, plug in the textbook example: 1 mole of an ideal gas at 273.15 K (0 °C) and 1 atmosphere of pressure. Solving V = nRT/P with R = 0.082057366 L·atm/(mol·K) gives V = 1 × 0.082057366 × 273.15 ÷ 1 = 22.414 litres — the classic "22.4 litres per mole" figure taught in every introductory chemistry course, and the exact molar volume this tool reports at STP. Temperature is always converted to kelvin internally regardless of whether you type °C or °F, because the equation is only valid for an absolute temperature scale; enter a value at or below absolute zero (−273.15 °C or −459.67 °F) and the calculator refuses to produce a number, since a negative absolute temperature is physically meaningless and would otherwise silently produce a negative, nonsensical volume. Beyond the basic four-variable solve, this calculator adds three features aimed at real chemistry and physics work rather than a homework shortcut. First, a mass-to-moles converter that reuses the same chemical-formula parser as the Molar Mass Calculator, so typing "CO2" or "O2" instantly gives you both the molar mass and, from it, the sample's density (ρ = PM/RT) and the mass of your chosen amount of gas. Second, a combined gas law mode for P₁V₁/T₁ = P₂V₂/T₂, useful whenever a fixed amount of gas moves between two pressure-volume-temperature states, such as a weather balloon rising through the atmosphere or a scuba tank warming in the sun. Third, both competing definitions of STP — the traditional 0 °C/1 atm convention that gives 22.414 L/mol, and the IUPAC 1982-onward 0 °C/100 kPa convention that gives 22.711 L/mol — are shown side by side, because a mismatch between these two is a real and common source of "wrong answer" confusion. It's worth being upfront about where the ideal gas law stops being accurate. Real gas molecules take up physical space and attract each other slightly, and PV = nRT ignores both effects. At everyday pressures and temperatures the error is small enough to ignore, but as pressure climbs past roughly 10 atmospheres, or temperature drops toward a gas's condensation point, the real behaviour diverges from the ideal prediction — this is what the van der Waals equation, (P + an²/V²)(V − nb) = nRT, corrects for with two gas-specific constants. This calculator always reports the ideal-gas answer, the right tool for most classroom and back-of-envelope engineering problems, but treat it as an approximation rather than a real-gas measurement near a gas's critical point. Every calculation runs entirely in your browser — nothing you type is uploaded anywhere.

Ideal Gas Law Calculator Formula & Method

PV = nRT, solved for the missing variable: P = nRT/V, V = nRT/P, n = PV/(RT), or T = PV/(nR). R is matched to the chosen unit system: 8.31446261815324 J/(mol·K) for SI, 0.082057366 L·atm/(mol·K), 62.363598 L·Torr/(mol·K), or 8.314462618 L·kPa/(mol·K). Density: ρ = PM/(RT). Combined gas law: P₁V₁/T₁ = P₂V₂/T₂.

Example: Ideal Gas Law Calculator

Input

n = 1 mol, T = 273.15 K (0 °C), P = 1 atm, solving for V

Result

V = 22.414 L

V = nRT/P = 1 × 0.082057366 × 273.15 ÷ 1 = 22.414 L, the standard molar volume at traditional STP.

Frequently Asked Questions – Ideal Gas Law Calculator

PV = nRT, where P is pressure, V is volume, n is the amount of gas in moles, T is the absolute temperature in kelvin, and R is the gas constant. It combines Boyle's law, Charles's law and Avogadro's law into one equation for an idealized gas.