Ideal Gas Law Calculator — Solve PV = nRT

Solve PV = nRT for pressure, volume, moles, or temperature. Auto-converts °C/°F to Kelvin and matches R to atm, kPa, or mmHg.

Solve for

Pressure unit

Temperature unit

= 273.15 K internally (PV = nRT always uses Kelvin)

Pressure (P)
1.0007 atm
P
1.0007 atm
V
22.4 L
n
1 mol
T
273.15 K

Using R = 0.08206atm/(mol·K), matched to your chosen pressure unit.

PV = nRT. Temperature is always converted to Kelvin internally before the calculation runs, no matter which unit you type it in — this avoids the most common student error with this formula (using Celsius or Fahrenheit directly). Assumes ideal gas behavior; real gases deviate at very high pressure or very low temperature.

91% found this helpful

Reference Values

Last verified:
Category Range What It Means Status
Ideal gas law PV = nRT Pressure × Volume = moles × gas constant × Temperature (Kelvin). Solve for any one variable given the other three. ★ Best
R — atm + liters 0.08206 L·atm/(mol·K) Use when pressure is in atmospheres and volume is in liters. The most common R value taught in intro chemistry. ★ Best
R — kPa + liters (SI) 8.314 L·kPa/(mol·K) SI-consistent value, numerically identical to 8.314 J/(mol·K). Use when pressure is in kilopascals. ★ Best
R — mmHg + liters 62.36 L·mmHg/(mol·K) Use when pressure is in millimeters of mercury (torr), common in older lab manuals and vacuum/manometer readings. Good
Kelvin conversion K = °C + 273.15 Temperature MUST be converted to Kelvin before use in PV = nRT. Using Celsius or Fahrenheit directly produces a wrong answer — this is the single most common student error with this formula. ★ Best
Fahrenheit to Kelvin K = (°F − 32) × 5/9 + 273.15 Convert Fahrenheit to Celsius first, then add 273.15. Good
Pressure unit conversions 1 atm = 101.325 kPa = 760 mmHg Standard atmosphere expressed in each supported pressure unit — used to keep the R constant matched to the chosen pressure unit. Good
Standard Temperature and Pressure (STP) 0°C (273.15 K), 1 atm IUPAC's older STP reference condition. One mole of an ideal gas occupies 22.4 L at STP — a common check value. Good

Source: IUPAC gas constant definition (CODATA R = 8.31446 J/(mol·K), rounded to 8.314 for classroom use) and standard general-chemistry textbook conventions (Atkins' Physical Chemistry; NIST). Pressure conversion factors from NIST Special Publication 811.

Worked Examples

Solve for Pressure — 1 Mole at STP (atm)

Solve for
Pressure (P)
n
1 mol
V
22.4 L
T
0°C (273.15 K)
Units
atm, L
1.001 atm

P = nRT/V = (1 × 0.08206 × 273.15) ÷ 22.4 = 1.001 atm — confirms the textbook rule that 1 mole of an ideal gas occupies about 22.4 L at standard temperature and pressure.

Solve for Volume — 2 Moles at Room Temperature (atm)

Solve for
Volume (V)
n
2 mol
P
1 atm
T
25°C (298.15 K)
Units
atm, L
48.93 L

V = nRT/P = (2 × 0.08206 × 298.15) ÷ 1 = 48.93 L. Note 25°C was converted to 298.15 K before use — plugging in 25 directly would give a badly wrong volume.

Solve for Temperature — Gas Cylinder (kPa)

Solve for
Temperature (T)
P
300 kPa
V
8 L
n
1 mol
Units
kPa, L
288.67 K (15.52°C)

T = PV/(nR) = (300 × 8) ÷ (1 × 8.314) = 288.67 K. Converted back to Celsius for readability: 288.67 − 273.15 = 15.52°C.

Solve for Moles — Vacuum Manometer Reading (mmHg)

Solve for
Moles (n)
P
760 mmHg
V
5 L
T
300 K (26.85°C)
Units
mmHg, L
0.2031 mol

n = PV/(RT) = (760 × 5) ÷ (62.36 × 300) = 3,800 ÷ 18,708 = 0.2031 mol, using the mmHg-matched R constant of 62.36 L·mmHg/(mol·K).

Why Kelvin Matters — Same Inputs, Fahrenheit Entry

Solve for
Pressure (P)
n
0.5 mol
V
12 L
T
77°F (298.15 K)
Units
atm, L
1.019 atm (correct) vs. 0.085 atm (wrong if Kelvin conversion is skipped)

Correct: T = 77°F → 25°C → 298.15 K, so P = (0.5 × 0.08206 × 298.15) ÷ 12 = 1.019 atm. If a student mistakenly plugs the Celsius number (25) straight into the formula as if it were Kelvin, P = (0.5 × 0.08206 × 25) ÷ 12 = 0.085 atm — off by a factor of about 12. This calculator always converts to Kelvin internally so this mistake can't happen.

How to Use This Calculator

  1. 1

    Choose what you're solving for

    Select Pressure, Volume, Moles, or Temperature — that field's input box disables since the calculator solves for it.

  2. 2

    Set your pressure and temperature units

    Pick atm, kPa, or mmHg for pressure (the calculator matches the correct R constant automatically) and °C, °F, or K for temperature.

  3. 3

    Enter the other three values

    Fill in whichever of P, V, n, and T you're not solving for. Values must be positive, and temperature must be above absolute zero.

  4. 4

    Read the result

    The answer updates instantly, shown in your chosen unit alongside a full P/V/n/T summary in the base units used for the calculation.

  5. 5

    Check the Kelvin conversion note

    Under the temperature field, the calculator shows the Kelvin-equivalent value it actually used — a quick way to confirm the conversion happened correctly.

What Each Value Means

Pressure (P) (atm / kPa / mmHg)
The force the gas exerts per unit area on its container walls. This calculator supports atmospheres (atm), kilopascals (kPa), and millimeters of mercury (mmHg), and automatically uses the R constant that matches your chosen unit.
Volume (V) (liters (L))
The space the gas occupies, always entered and returned in liters in this calculator to keep the math consistent with the standard R constant values.
Moles (n) (mol)
The amount of gas present, measured in moles — one mole is 6.022 × 10^23 particles (Avogadro's number).
Temperature (T) (Kelvin (K))
Absolute temperature measured from absolute zero. The ideal gas law only works correctly in Kelvin, so this calculator converts any °C or °F entry to Kelvin before running the calculation.
Gas constant (R) (L·atm/(mol·K) or equivalent)
A proportionality constant linking pressure, volume, moles, and temperature. Its numeric value changes with the pressure/volume units chosen (0.08206, 8.314, or 62.36) but represents the same underlying physical constant in every case.

Frequently Asked Questions

Why does the ideal gas law require Kelvin instead of Celsius or Fahrenheit?
PV = nRT is derived from a proportional relationship where temperature must be measured from absolute zero — the point where gas particles theoretically stop moving. Celsius and Fahrenheit have arbitrary zero points (freezing point of water, a brine mixture), so plugging a Celsius or Fahrenheit number directly into the formula breaks the proportionality and gives a wrong answer, sometimes by a huge margin. Kelvin starts at absolute zero, so it's the only scale where doubling the temperature actually doubles the gas's thermal energy in the way the formula assumes. This calculator converts whatever unit you type into Kelvin automatically, so you can enter °C or °F and still get a correct result.
What is the value of R and why does it change?
R is the universal gas constant, and its numeric value depends only on which units you're using for pressure and volume — it's not actually a different physical constant, just the same constant expressed differently. Use R = 0.08206 L·atm/(mol·K) when pressure is in atmospheres, R = 8.314 L·kPa/(mol·K) when pressure is in kilopascals (this is the SI-consistent value, identical to 8.314 J/(mol·K)), and R = 62.36 L·mmHg/(mol·K) when pressure is in millimeters of mercury. This calculator picks the matching R automatically based on the pressure unit you select, so you never have to look it up or convert it yourself.
How do I solve for volume, moles, or temperature instead of pressure?
Pick which variable you want in the "Solve for" selector at the top of the calculator. The input field for that variable disables itself, and you fill in the other three. The math is just PV = nRT rearranged: V = nRT/P, n = PV/(RT), and T = PV/(nR). The calculator does this rearrangement for you, so you always fill in three known values and read off the fourth.
Does the ideal gas law work for real gases like air, oxygen, or CO2?
It's a very good approximation for most everyday conditions — room temperature, atmospheric-to-moderate pressure — which is why general chemistry courses teach it first. It breaks down at very high pressure or very low temperature, where gas molecules take up meaningful volume relative to the container and start attracting each other, both effects the ideal gas law ignores. For those conditions, chemists use corrections like the van der Waals equation. For typical classroom problems, lab bench conditions, and back-of-envelope engineering estimates, PV = nRT is accurate enough.
What is STP and why does 1 mole equal 22.4 liters there?
STP (Standard Temperature and Pressure) in the older IUPAC convention is 0°C (273.15 K) and 1 atm. Plugging n = 1 mol, T = 273.15 K, and P = 1 atm into V = nRT/P with R = 0.08206 gives V ≈ 22.4 L — a number worth memorizing because it lets you sanity-check other gas law answers at a glance. Note IUPAC's current official STP definition uses 100 kPa instead of 1 atm, which shifts molar volume slightly to about 22.7 L; check which convention your course uses before relying on either number as a hard rule.