Ideal Gas Law Calculator
Solve PV = nRT for pressure, volume, amount of gas, or temperature - enter any three known values to find the fourth.
🎈 What is the Ideal Gas Law?
The ideal gas law is the equation PV = nRT, which relates the pressure, volume, amount, and temperature of an idealized gas. It is one of the most useful equations in chemistry and physics because it combines three earlier gas laws (Boyle's, Charles's, and Avogadro's) into a single relationship that lets you find any one variable when the other three are known.
The ideal gas law shows up constantly in real work: calculating how much gas is in a compressed cylinder, predicting how a weather balloon expands as it rises through the atmosphere, sizing a chemistry lab's fume hood ventilation, determining the molar mass of an unknown vapour from a measured sample, and working out combustion product volumes in engineering.
A common misconception is that the ideal gas law works perfectly for every gas under every condition. In reality it is an approximation that assumes gas particles have no volume and no intermolecular attraction. Real gases follow this law closely at low pressure and high temperature, but deviate at high pressure or near their condensation point, where a compressibility factor correction becomes necessary.
This calculator removes the need to manually rearrange the algebra. Pick which variable is unknown, Solve P, Solve V, Solve n, or Solve T, enter the other three known values, and it returns the missing value instantly along with the exact rearranged formula and substituted numbers used to compute it.
📐 Formula
📖 How to Use This Calculator
Steps
💡 Example Calculations
Example 1 — Molar volume at STP (Solve V)
1 mole of an ideal gas at 273.15 K and 1 atm - find the volume.
Example 2 — Pressure in a sealed flask (Solve P)
2 mol of gas fills a 10 L flask at 300 K - find the pressure.
Example 3 — Moles of gas from a tank reading (Solve n)
A 15 L tank reads 2 atm at 350 K - find the amount of gas.
Example 4 — Temperature of a compressed sample (Solve T)
1.2 mol of gas occupies 20 L at 1.5 atm - find the temperature.
❓ Frequently Asked Questions
🔗 Related Calculators
What is the ideal gas law formula?
The ideal gas law is PV = nRT, where P is pressure (atm), V is volume (L), n is the amount of gas (mol), R is the ideal gas constant (0.0821 L·atm/(mol·K)), and T is absolute temperature (K). It combines Boyle's Law, Charles's Law, and Avogadro's Law into a single equation relating all four variables.
What is R in the ideal gas law equation?
R is the ideal gas constant. Its value depends on the units used: R = 0.0821 L·atm/(mol·K) when pressure is in atmospheres and volume is in litres, or R = 8.314 J/(mol·K) when using SI units (pascals and cubic metres). This calculator uses the atm/L/mol/K form, the most common convention in introductory chemistry.
How do I convert Celsius to Kelvin for the ideal gas law?
Add 273.15 to the Celsius temperature: K = °C + 273.15. The ideal gas law requires absolute temperature because it is derived from the kinetic theory of gases, where temperature must start at absolute zero. Using Celsius directly gives incorrect (and sometimes negative or infinite) results.
What is standard temperature and pressure (STP)?
STP is defined as 0°C (273.15 K) and 1 atm of pressure. At STP, one mole of any ideal gas occupies 22.4 L, a value known as the standard molar volume. This calculator's default values (n=1, T=273.15 K, P=1 atm) reproduce this exact result, V = 22.43 L, as a built-in sanity check.
Can the ideal gas law be used for real gases?
Yes, as an approximation. Real gases deviate from ideal behaviour at high pressure and low temperature, where intermolecular forces and molecular volume become significant. For most everyday chemistry problems at moderate conditions, the ideal gas law is accurate within a few percent. For more precise work on real gases, a compressibility factor (Z) correction is applied.
How do you solve for temperature using the ideal gas law?
Rearrange PV = nRT to solve for T: T = PV / (nR). Enter the known pressure, volume, and moles, and select Solve T. For example, with P = 1.5 atm, V = 20 L, and n = 1.2 mol: T = (1.5 × 20) / (1.2 × 0.0821) = 304.51 K, which is 31.36°C.
What happens to volume if pressure doubles at constant temperature and moles?
According to Boyle's Law (a special case of PV = nRT), volume is inversely proportional to pressure when n and T are constant. If pressure doubles, volume is halved. You can verify this directly with the calculator: hold n and T fixed, double P in Solve V mode, and confirm the resulting V is exactly half.
What is the difference between the ideal gas law and Boyle's Law or Charles's Law?
Boyle's Law (PV = constant at fixed T and n) and Charles's Law (V/T = constant at fixed P and n) are both special cases of the ideal gas law PV = nRT. The ideal gas law is the general equation; Boyle's and Charles's Laws describe what happens when you hold two of the four variables constant and vary the other two.
Does the ideal gas law work for a mixture of gases?
Yes, if n represents the total moles of all gases combined, PV = nRT still holds for the total pressure (Dalton's Law of Partial Pressures). Each gas in the mixture also independently satisfies the ideal gas law using its own partial pressure and mole count.
What units does this calculator use for pressure, volume and temperature?
Pressure is in atmospheres (atm), volume is in litres (L), amount of gas is in moles (mol), and temperature is in kelvin (K). These are the standard units that pair correctly with R = 0.0821 L·atm/(mol·K). If your data is in other units (kPa, mL, °C), convert before entering values.
Why is negligible molecular volume an assumption of the ideal gas law?
The ideal gas law treats gas particles as point masses with no volume of their own, occupying only empty space between collisions. This assumption breaks down at high pressure, where molecules are packed closely enough that their actual volume becomes a meaningful fraction of the container volume, causing real gases to deviate from ideal predictions.
Can I use the ideal gas law to find the molar mass of an unknown gas?
Yes, indirectly. First solve for moles (n) using PV = nRT with a measured mass sample's pressure, volume and temperature. Then divide the known mass of the sample by n to get molar mass (g/mol). This technique is commonly used in the lab to identify unknown gases from their measured PVT behaviour.