Gas Law Calculator — calculate gas law using standard chemistry formulas. Worked example with units.
A gas law calculator applies the ideal gas law and its component laws (Boyle's, Charles's, Gay-Lussac's, Avogadro's, and the combined gas law) to relate the pressure, volume, temperature, and moles of a gas. The ideal gas law (PV = nRT) is a fundamental model of gas behaviour that works well at moderate pressures and temperatures, with deviations occurring for real gases at high pressures or near the liquefaction point.
Used in chemistry and physics courses, engineering calculations for compressed gas systems, HVAC, pneumatic systems, atmospheric science, and any application involving gas behaviour under changing conditions.
The four state variables are linked, so changing one quantity changes at least one of the others unless the amount of gas and temperature, pressure, or volume are held constant. Before calculating, identify which values belong to the same sample and state. A sealed container can be treated differently from a gas that flows continuously through a pipe, and a gas mixture may need partial pressures rather than one undifferentiated pressure.
Remember that the gas constant has several equivalent forms. Use 0.08206 L·atm/(mol·K) with litres and atmospheres, or 8.314 J/(mol·K) with cubic metres and pascals. Mixing a pressure unit from one form with a volume unit from the other changes the answer by a large conversion factor.
For a useful cross-check, compare the ideal gas law calculator with the molarity calculator when a question moves between gas state variables and solution concentration.
Ideal Gas Law: PV = nRT, where R = 8.314 J/(mol·K) = 0.08206 L·atm/(mol·K)
Boyle's Law (constant T, n): P₁V₁ = P₂V₂
Charles's Law (constant P, n): V₁/T₁ = V₂/T₂ (T in Kelvin)
Gay-Lussac's Law (constant V, n): P₁/T₁ = P₂/T₂
Combined Gas Law: P₁V₁/T₁ = P₂V₂/T₂
van der Waals: (P + a(n/V)²)(V − nb) = nRT
STP (Standard Temperature and Pressure): 0°C (273.15 K) and 1 atm — 1 mole of ideal gas occupies 22.414 L. SATP (Standard Ambient): 25°C (298.15 K) and 1 bar — 1 mole occupies 24.789 L. NTP (Normal Temperature and Pressure, US engineering): 20°C and 1 atm — 1 mole occupies 24.055 L. Always convert Celsius to Kelvin before applying gas laws: K = °C + 273.15.
For example, one mole at 25°C and 1 atm occupies about 24.47 L under the ideal model. If a measured sample gives a different value, check whether the pressure is absolute, whether the container volume includes fittings or dead space, and whether the temperature has equilibrated. The discrepancy is useful evidence about measurement or non-ideal behaviour, not a reason to change the gas constant until the units have been checked.
Gas law calculations are based on the ideal gas approximation. For engineering design of pressure vessels, gas pipelines, HVAC systems, and compressed gas equipment, consult a licensed mechanical or chemical engineer and follow applicable codes (ASME, ISO, OSHA).