Ideal Gas Law Calculator (PV = nRT)

Solve for any variable with unit support. Plus quick two-state calculators for Boyle, Charles, and Gay-Lussac. Private by design — everything runs locally in your browser.

PV = nRT — Solve for

Enter the other three.
g/mol, used only when amount is grams.
Choose convenient units (auto-converts).
Auto uses scientific notation for very large or small values.

Result

Solved value
Worked steps
Choose the unknown and calculate to see the rearranged formula, conversions, substitution, and answer.
Notes
Use absolute temperature (K). If you enter °C, we convert to K internally.

Advertisement

Formula Reference

Use any rearranged form when the other three variables are known.
UnknownRearranged formula
PressureP = nRT / V
VolumeV = nRT / P
Amountn = PV / RT
TemperatureT = PV / nR
R constantCompatible units
8.314 J/(mol K)Pa, m³, mol, K
0.082057 L atm/(mol K)atm, L, mol, K
62.364 L torr/(mol K)torr or mmHg, L, mol, K
8.314 kPa L/(mol K)kPa, L, mol, K

Two-State Gas Laws

Inputs

Result

Assumes constant temperature and moles (isothermal). Uses the same unit conversions as PV=nRT.

How this works (Ideal Gas Law & Classic Gas Laws)

The ideal gas law ties together four core variables—pressure (P), volume (V), amount of substance (n) in moles, and absolute temperature (T)—through the compact relation PV = nRT. In practice this means that if you know any three of the variables, you can compute the fourth. Our calculator handles the algebra, unit conversions, and numeric precision for you. Enter values in your preferred units (including atm, kPa, bar, psi, torr, inHg, L, mL, cm³, m³, ft³, gallons, mol, mmol, grams with molar mass, particles, K, or °C), choose a convenient gas constant R, and we convert internally to consistent units before returning results in the units you selected.

A key detail is that temperature in gas laws is always measured on an absolute scale. If you enter °C, the tool converts to kelvin via T(K) = T(°C) + 273.15. Values at or below 0 K are non-physical, so the calculator alerts you if input choices would imply an impossible state. Similarly, pressure and volume must be positive for physically meaningful results.

For quick comparisons between two states of the same sample of gas, the classic single-variable relations drop out of PV = nRT by holding two variables constant:

  • Boyle’s Law (isothermal, constant T and n): P₁V₁ = P₂V₂. Increasing pressure compresses volume proportionally.
  • Charles’s Law (isobaric, constant P and n): V₁/T₁ = V₂/T₂. Heating a gas expands its volume linearly with absolute temperature.
  • Gay-Lussac’s Law (isochoric, constant V and n): P₁/T₁ = P₂/T₂. Heating at fixed volume raises pressure in direct proportion to temperature.

Two widely referenced reference points are STP (1 atm and 273.15 K) and SATP (1 bar and 298.15 K). At STP, one mole of an ideal gas occupies approximately 22.414 L; at SATP the molar volume is about 24.465 L. Use the STP button for a quick check or classroom demonstration, then adjust to match your assignment or lab protocol.

Remember that the “ideal” model assumes point-like molecules with no intermolecular forces and perfectly elastic collisions. This approximation works best at low pressures and moderate temperatures. At high pressures, very low temperatures, or near condensation, real gases deviate: compressibility factors differ from one, and equations of state such as van der Waals may be more accurate. For typical chemistry and physics coursework, though, PV = nRT provides reliable intuition and quick, transparent calculations.

Tips: check that temperatures are in K, keep units consistent, and verify significant figures. For mixtures, Dalton’s law lets you use partial pressures in the same framework: Ptotal = ΣPi. All computations here run locally in your browser for privacy.

Accuracy note

Last reviewed: June 30, 2026. Formulas used: PV = nRT, P₁V₁/T₁ = P₂V₂/T₂, and direct gas-law special cases. Constants and definitions are checked against NIST/CODATA gas constant references and standard general chemistry definitions of STP, SATP, Dalton's law, and ideal-gas assumptions.

Solved Examples

Solve pressure

Givens: n = 2.00 mol, T = 300 K, V = 10.0 L, R = 0.082057 L atm/(mol K).

Rearrange: P = nRT / V.

Substitute: P = (2.00)(0.082057)(300) / 10.0.

Answer: P = 4.92 atm.

Solve volume at STP

Givens: P = 1 atm, n = 1.00 mol, T = 273.15 K, R = 0.082057 L atm/(mol K).

Rearrange: V = nRT / P.

Substitute: V = (1.00)(0.082057)(273.15) / 1.

Answer: V = 22.41 L.

Solve moles

Givens: P = 2.00 atm, V = 5.00 L, T = 298.15 K, R = 0.082057 L atm/(mol K).

Rearrange: n = PV / RT.

Substitute: n = (2.00)(5.00) / ((0.082057)(298.15)).

Answer: n = 0.409 mol.

Solve temperature from Celsius inputs

Givens: P = 101.325 kPa, V = 12.0 L, n = 0.500 mol, R = 8.314 kPa L/(mol K).

Rearrange: T = PV / nR.

Substitute: T = (101.325)(12.0) / ((0.500)(8.314)) = 292.5 K.

Answer: T = 19.4 °C after subtracting 273.15.

FAQ

What R value should I use for the ideal gas law?

Use an R value whose units match the pressure and volume units in your setup. Common choices are 8.314 J/(mol K) for Pa·m³ or kPa·L work, 0.082057 L·atm/(mol K), and 62.364 L·torr/(mol K). This calculator converts inputs internally, so any listed R option can be used for the same physical problem.

Why must temperature be in kelvin?

Gas law ratios depend on absolute temperature. Kelvin starts at absolute zero, so doubling kelvin temperature doubles the ideal-gas pressure or volume when the other variables are held constant. Celsius has an offset, so it cannot be used directly in PV = nRT.

Can I enter Celsius in this calculator?

Yes. Choose °C for the temperature unit and enter the Celsius value. The calculator converts it to kelvin with T(K) = T(°C) + 273.15 before applying the formula.

When is the ideal gas law inaccurate?

PV = nRT is least accurate at high pressure, very low temperature, or near condensation, where molecular volume and attractions matter. It is usually a good approximation for dilute gases away from phase changes.

Does the ideal gas law work for gas mixtures?

Yes, for ideal mixtures you can use the total moles with total pressure, or use Dalton's law with each gas's partial pressure. The mixture should still be treated as ideal for the result to be reliable.

How are STP and SATP different?

STP is commonly 1 atm and 273.15 K, giving about 22.414 L per mole for an ideal gas. SATP is commonly 1 bar and 298.15 K, giving about 24.465 L per mole. Always match the convention your class or lab uses.

Explore more tools