CalcTune
🔬
Science · Chemistry

Ideal Gas Law Calculator

Solve for any variable in PV = nRT. Enter three known values and instantly calculate the unknown pressure, volume, amount of substance, or temperature.

mol
Example values — enter yours above
Result
1.0006atm

R = 8.314 J/(mol·K)

The Ideal Gas Law: PV = nRT Explained

The ideal gas law is one of the most fundamental equations in chemistry and physics. Written as PV = nRT, it elegantly combines four measurable properties of a gas — pressure, volume, amount of substance, and temperature — into a single relationship. Whether you are a student balancing stoichiometry problems, a laboratory chemist scaling up a reaction, or an engineer designing a pneumatic system, this equation is an indispensable tool for predicting gas behavior.

This calculator lets you solve for any one of the four variables when the other three are known. Simply select the variable you want to find, enter the known values with your preferred units, and the result appears instantly.

What Each Variable Represents

Pressure (P) is the force exerted by gas molecules per unit area as they collide with the walls of a container. It can be expressed in pascals (Pa), kilopascals (kPa), atmospheres (atm), or bar. Standard atmospheric pressure at sea level is 101,325 Pa, or 1 atm.

Volume (V) is the space the gas occupies, measured in liters (L), milliliters (mL), or cubic meters (m³). One liter equals 0.001 m³, and the molar volume of an ideal gas at STP (0 °C, 1 atm) is approximately 22.414 liters.

Amount of substance (n) is measured in moles (mol). One mole contains approximately 6.022 × 10²³ particles (Avogadro's number). The mole bridges the macroscopic measurement of mass with the microscopic world of atoms and molecules.

Temperature (T) must be expressed in kelvin (K) for the ideal gas law to hold. Kelvin is the absolute temperature scale: 0 K (absolute zero) is the theoretical point at which all molecular motion ceases. To convert from Celsius, add 273.15; to convert from Fahrenheit, use T(K) = (T(°F) − 32) × 5/9 + 273.15.

The Universal Gas Constant (R)

The gas constant R = 8.314 J/(mol·K) is a universal proportionality constant that makes the equation dimensionally consistent in SI units. When pressure is in pascals and volume is in cubic meters, this value gives the correct result in moles and kelvin. Different unit systems use different values of R — for example, R = 0.08206 L·atm/(mol·K) is convenient when working in liters and atmospheres — but our calculator handles all unit conversions automatically by working internally in SI.

R is not an independently derived constant but is the product of Boltzmann's constant (k_B = 1.380649 × 10⁻²³ J/K) and Avogadro's number (N_A = 6.02214076 × 10²³ mol⁻¹). Its exact value was fixed by the 2019 redefinition of the SI base units.

Deriving Each Variable

Starting from PV = nRT, simple algebra lets you isolate any variable:

Pressure: P = nRT ÷ V. This is useful when you know the number of moles of a gas confined to a known volume at a set temperature and want to know the resulting pressure — for example, inside a sealed container or a scuba tank.

Volume: V = nRT ÷ P. This tells you how much space a given amount of gas will occupy at a given temperature and pressure. Chemists use this form to predict the volume of a gaseous product produced in a reaction.

Moles: n = PV ÷ (RT). If you measure the pressure, volume, and temperature of a gas sample, you can calculate how many moles are present. Rearranging further with the molar mass allows you to determine the mass of gas collected.

Temperature: T = PV ÷ (nR). This form is less common but is used in thermodynamic analyses, for instance to determine the temperature of a gas after a process where pressure and volume have been measured.

When Is a Gas 'Ideal'?

A gas behaves ideally when two simplifying assumptions hold: (1) the gas molecules themselves occupy negligible volume compared to the container, and (2) there are no intermolecular forces between the molecules — they interact only through perfectly elastic collisions. Under these conditions, the internal energy of the gas depends only on temperature.

In practice, real gases approximate ideal behavior well at low pressures (below about 10 atm) and high temperatures (well above the gas's boiling point). Under these conditions, molecules are far apart and the attractive forces between them are small relative to their kinetic energy. Common gases such as nitrogen (N₂), oxygen (O₂), hydrogen (H₂), helium (He), and noble gases behave nearly ideally under everyday conditions.

Deviations become significant at high pressures or low temperatures, where molecules are crowded close together and intermolecular attractions become important. The van der Waals equation is a common first correction for non-ideal behavior, adding terms to account for molecular volume (b) and intermolecular attractions (a).

Practical Applications

The ideal gas law has countless real-world applications. In automotive engineering, it governs the pressure inside tires and the behavior of air–fuel mixtures in internal combustion engines. In medicine, it underlies the design of ventilators and anesthetic delivery systems. In atmospheric science, it helps meteorologists calculate air density and understand weather patterns.

In the laboratory, chemists use PV = nRT to determine the molar mass of unknown gases by measuring their pressure, volume, temperature, and mass. Industrial processes such as the Haber–Bosch synthesis of ammonia rely on precise control of gas pressure and temperature predicted by the ideal gas law. Even in everyday life, understanding why a balloon shrinks in the cold or a sealed container bulges in the heat comes back to this simple equation.

Tips for Using This Calculator

Select the variable you want to solve for using the toggle at the top. The three corresponding input fields will appear. Each pressure and volume input has a unit dropdown — choose your preferred unit and the calculator converts automatically.

Temperature is particularly important to get right. Always check that the temperature you enter makes physical sense for the scenario. If working in Celsius or Fahrenheit, select the corresponding unit from the dropdown — the calculator converts to kelvin internally. Remember that absolute zero (−273.15 °C or −459.67 °F) is the lower bound: no physical temperature can be at or below this value.

When no values are entered, the calculator shows example results at STP (0 °C, 1 atm, 1 mol → 22.4 L). Use the share button to save and share a specific calculation with your own values.

Frequently Asked Questions

What is the ideal gas law?

The ideal gas law is the equation PV = nRT, where P is pressure, V is volume, n is the number of moles of gas, R is the universal gas constant (8.314 J/mol·K), and T is temperature in kelvin. It describes the relationship between these four properties for an idealized gas in which molecules have negligible size and no intermolecular forces.

What units should I use for the ideal gas law?

In SI units: pressure in pascals (Pa), volume in cubic meters (m³), temperature in kelvin (K), and R = 8.314 J/(mol·K). Alternatively, using pressure in atm, volume in liters (L), and R = 0.08206 L·atm/(mol·K) is common in chemistry. This calculator accepts Pa, kPa, atm, and bar for pressure; L, mL, and m³ for volume; and K, °C, and °F for temperature, and converts automatically.

Why must temperature be in kelvin?

The ideal gas law requires temperature on an absolute scale because it reflects the total thermal (kinetic) energy of the gas molecules. At absolute zero (0 K), all molecular motion stops and pressure and volume would collapse to zero. Celsius and Fahrenheit scales place zero arbitrarily — using them directly in PV = nRT produces incorrect results. Always add 273.15 to convert Celsius to kelvin.

What is STP and what is molar volume at STP?

STP (Standard Temperature and Pressure) is defined by IUPAC as 0 °C (273.15 K) and 1 bar (100 kPa). At these conditions, one mole of an ideal gas occupies 22.711 liters. The older definition used 1 atm instead of 1 bar, giving 22.414 liters per mole. This calculator defaults to 0 °C, 1 atm, and 1 mol to show the classic 22.4 L example.

How do real gases differ from ideal gases?

Real gas molecules have finite volume and experience intermolecular forces (attraction and repulsion), both of which the ideal gas law ignores. At low pressures and high temperatures, these effects are negligible and real gases behave nearly ideally. At high pressures or near the boiling point, deviations become significant and more complex equations — such as the van der Waals equation — must be used for accurate results.