Ideal Gas Law Calculator (PV = nRT)

Enter any three variables to solve for the fourth. The calculator automatically selects the correct R value based on your units.

⚠ Temperature seems very low for Kelvin. Did you forget to convert from °C?

What is the Ideal Gas Law?

The Ideal Gas Law is a fundamental equation in chemistry and physics that relates four key properties of a gas: pressure (P), volume (V), the number of moles (n), and temperature (T). The equation is written as:

PV = nRT

where R is the universal gas constant. This law assumes the gas behaves ideally — meaning the gas molecules have no volume and no intermolecular forces. While no real gas is perfectly ideal, this law provides excellent approximations at moderate temperatures and pressures.

PV=nRT Formula — All Rearranged Forms

You can rearrange PV = nRT to solve for any variable:

P = nRT / V
V = nRT / P
n = PV / RT
T = PV / nR

Gas Constant (R) Values Table

R ValueUnitsWhen to Use
0.08206L·atm/(mol·K)P in atm, V in L
8.314J/(mol·K)SI units: P in Pa, V in m³
8.314kPa·L/(mol·K)P in kPa, V in L
62.36L·mmHg/(mol·K)P in mmHg, V in L
1.987cal/(mol·K)Energy in calories

See the full Gas Constant R Values reference table for more details.

PV=nRT Units

VariableCommon UnitsSI Unit
Pressure (P)atm, kPa, mmHg, psiPa (Pascal)
Volume (V)L, mL
Moles (n)molmol
Temperature (T)K, °C, °FK (Kelvin)
Gas Constant (R)Depends on P & V units8.314 J/(mol·K)

For a complete guide, visit PV=nRT Units.

Step-by-Step Examples

Example 1: Solve for Pressure

Given: 2.0 mol of gas in a 10.0 L container at 300 K. Find P.

1. Write the formula: P = nRT / V
2. Choose R = 0.08206 L·atm/(mol·K) (P in atm, V in L)
3. Substitute: P = (2.0)(0.08206)(300) / 10.0
4. Calculate: P = 49.236 / 10.0 = 4.924 atm

Example 2: Solve for Volume

Given: 1.5 mol of gas at 1.0 atm and 273.15 K (0°C). Find V.

1. Write the formula: V = nRT / P
2. Substitute: V = (1.5)(0.08206)(273.15) / 1.0
3. Calculate: V = 33.62 L

Example 3: Solve for Moles

Given: A 5.0 L container at 2.5 atm and 350 K. Find n.

1. Write the formula: n = PV / RT
2. Substitute: n = (2.5)(5.0) / (0.08206)(350)
3. Calculate: n = 12.5 / 28.721 = 0.4352 mol

Example 4: Solve for Temperature

Given: 0.5 mol of gas at 3.0 atm in a 2.0 L container. Find T.

1. Write the formula: T = PV / nR
2. Substitute: T = (3.0)(2.0) / (0.5)(0.08206)
3. Calculate: T = 6.0 / 0.04103 = 146.2 K

What is n in PV=nRT?

In the ideal gas law, n represents the number of moles of gas. A mole is a counting unit equal to 6.022 × 10²³ particles (Avogadro's number). You can calculate the number of moles from the mass of a gas using:

n = mass / molar mass

For example, 32 g of O₂ (molar mass = 32 g/mol) equals exactly 1 mole. If you need to find moles using gas properties, rearrange PV=nRT: n = PV/(RT).

Ideal Gas Law vs Combined Gas Law

Use the Ideal Gas Law (PV=nRT) when you know or need to find the number of moles of gas. Use the Combined Gas Law (P₁V₁/T₁ = P₂V₂/T₂) when comparing the same gas at two different states (before and after a change) and moles stay constant.

Ideal Gas Law with Molar Mass

Since n = m/M (mass divided by molar mass), you can rewrite the ideal gas law as:

PV = (m/M)RT

This is useful for finding the molar mass of an unknown gas. For gas density (ρ = m/V), rearrange to:

ρ = PM / (RT)

Frequently Asked Questions

  • PV=nRT is the Ideal Gas Law. P stands for pressure, V for volume, n for the number of moles of gas, R for the universal gas constant, and T for temperature in Kelvin. It describes the relationship between these four state variables for an ideal gas.

  • In PV=nRT, n represents the number of moles of gas. One mole equals 6.022 × 10²³ particles (Avogadro's number). You can calculate n from the mass of gas divided by its molar mass: n = mass / molar mass.

  • R is the universal gas constant. Its value depends on the units you use: R = 0.08206 L·atm/(mol·K) when P is in atm and V in liters, R = 8.314 J/(mol·K) in SI units, R = 8.314 kPa·L/(mol·K) when P is in kPa, or R = 62.36 L·mmHg/(mol·K) when P is in mmHg.

  • Temperature must always be in Kelvin. For the other variables, the units must be consistent with your chosen R value. Common combinations: P in atm + V in L + R = 0.08206, or P in kPa + V in L + R = 8.314, or P in Pa + V in m³ + R = 8.314.

  • Rearrange PV=nRT to solve for P: P = nRT/V. Plug in the number of moles (n), the gas constant (R), the temperature in Kelvin (T), and the volume (V), then calculate. Make sure your units are consistent with the R value you choose.

  • The most common values of R are: 0.08206 L·atm/(mol·K), 8.314 J/(mol·K), 8.314 kPa·L/(mol·K), 62.36 L·mmHg/(mol·K), and 1.987 cal/(mol·K). Choose the value that matches the pressure and volume units in your problem.

  • The ideal gas law is used to calculate any one of the four variables (P, V, n, T) when the other three are known. Applications include determining gas volumes in chemical reactions, calculating pressures in sealed containers, finding the molar mass of an unknown gas, and estimating gas behavior under different conditions.