TSE.
MathematicsFinanceHealthPhysicsEngineeringBrowse all

Physics · Thermodynamics · Gas Laws

Ideal Gas Law Calculator

Calculate pressure, volume, moles, or temperature of an ideal gas using the ideal gas law PV = nRT.

Calculator

Advertisement

Formula

P is the absolute pressure of the gas (in Pascals), V is the volume occupied by the gas (in cubic meters), n is the amount of gas in moles, R is the universal gas constant (8.314 J\,\text{mol}^{-1}\text{K}^{-1}), and T is the absolute temperature in Kelvin. Rearrange to solve for any one variable given the other three.

Source: NIST Chemistry WebBook — Thermophysical Properties of Gas Phase Species; Atkins & de Paula, Physical Chemistry, 10th ed.

How it works

The ideal gas law is a thermodynamic equation of state that describes the behavior of a hypothetical ideal gas — one in which particles have no intermolecular forces and occupy negligible volume. The law consolidates Boyle's Law (P ∝ 1/V at constant T, n), Charles's Law (V ∝ T at constant P, n), and Avogadro's Law (V ∝ n at constant P, T) into a single elegant relation. It is one of the most widely applied equations in physical science.

The formula is written as PV = nRT, where P is absolute pressure in Pascals, V is volume in cubic meters, n is the number of moles of gas, R is the universal gas constant (8.314 J mol⁻¹ K⁻¹), and T is absolute temperature in Kelvin. To find an unknown variable, simply rearrange: P = nRT/V, V = nRT/P, n = PV/RT, or T = PV/nR. All inputs must use SI base units or be converted before calculation to ensure consistency.

This calculator is used across many disciplines. Chemists use it to find the molar quantity of a gas produced during a reaction. Mechanical engineers apply it to model gas behavior in pistons and compressors. HVAC engineers use it to estimate air density changes with temperature. Educators assign problems involving PV = nRT to demonstrate the macroscopic emergent properties of statistical ensembles of gas molecules. Even atmospheric scientists use the ideal gas law as a first approximation when modeling air parcels.

Worked example

Problem: A sealed container holds 2 moles of nitrogen gas at a temperature of 300 K. What is the pressure if the container has a volume of 0.050 m³?

Step 1 — Identify knowns: n = 2 mol, T = 300 K, V = 0.050 m³, R = 8.314 J mol⁻¹ K⁻¹.

Step 2 — Rearrange for pressure: P = nRT / V

Step 3 — Substitute values: P = (2 × 8.314 × 300) / 0.050

Step 4 — Calculate: P = 4988.4 / 0.050 = 99,768 Pa ≈ 99.8 kPa

This is slightly below standard atmospheric pressure (101,325 Pa), which makes physical sense for a relatively large container with 2 moles at near-room temperature. You can verify this directly using the calculator above by selecting 'Pressure', entering V = 0.05, n = 2, and T = 300.

Limitations & notes

The ideal gas law assumes that gas molecules have no volume and no intermolecular forces, which are approximations that break down under real-world conditions. At very high pressures (above approximately 10 atm) or very low temperatures (close to the gas's boiling point), real gas behavior deviates significantly from ideal predictions — this is better captured by the Van der Waals equation or other equations of state. The law also does not apply to gases near their liquefaction point or to dense plasmas. Additionally, all inputs must be in SI units (Pascals, cubic meters, Kelvin) and temperature must be absolute (Kelvin, not Celsius or Fahrenheit) for the formula to be valid. Using gauge pressure instead of absolute pressure is a common source of error. The calculator does not account for mixtures of non-reacting gases using partial pressures, though Dalton's Law can be applied alongside PV = nRT for such cases.

Frequently asked questions

What is the value of the ideal gas constant R?

The universal gas constant R is exactly 8.314 J mol⁻¹ K⁻¹ (joules per mole per Kelvin). In other unit systems it can also be expressed as 0.08206 L·atm mol⁻¹ K⁻¹ or 8.314 Pa·m³ mol⁻¹ K⁻¹. This calculator uses the SI value of 8.314 for consistency with Pascals and cubic meters.

Do I need to convert Celsius to Kelvin before using this calculator?

Yes. The ideal gas law requires absolute temperature in Kelvin. To convert from Celsius, add 273.15: T(K) = T(°C) + 273.15. For example, 25°C becomes 298.15 K. Using Celsius directly will give an incorrect result because the equation is derived from absolute thermodynamic temperature.

Can this calculator be used for real gases?

The calculator uses the ideal gas law, which is an approximation. For real gases at moderate temperatures and pressures (roughly 0–10 atm and above 0°C for most diatomic gases), the error is typically less than 1–2%. For high pressures or low temperatures, consider using the Van der Waals equation or the Peng-Robinson equation of state for more accurate results.

What units does this calculator use for pressure and volume?

Pressure must be entered in Pascals (Pa) and volume in cubic meters (m³). If your values are in atmospheres or liters, convert them first: 1 atm = 101,325 Pa; 1 liter = 0.001 m³. The output pressure is returned in Pascals, which you can then convert to kPa, atm, or bar as needed.

How does the ideal gas law relate to Boyle's and Charles's laws?

Boyle's Law (PV = constant at fixed n, T) and Charles's Law (V/T = constant at fixed n, P) are both special cases of the ideal gas law PV = nRT. When temperature is held constant, PV = nRT reduces to Boyle's Law. When pressure is fixed, V = (nR/P)T gives Charles's linear relationship between volume and temperature. The ideal gas law unifies all these empirical observations into one equation.

Last updated: 2025-01-15 · Formula verified against primary sources.