Ideal Gas Law Calculator

Solve the ideal gas law PV = nRT for pressure, volume, moles or temperature with automatic unit conversion (atm, kPa, bar, psi, L, m³, °C, K, °F).

Last updated 28 November 2026

ResultEnter values to calculate
    Show calculation steps

    What is the ideal gas law?

    Ideal Gas Law: For an ideal gas, the product of pressure and volume equals the amount of gas times the gas constant times the absolute temperature. — Émile Clapeyron, 1834

    A gas is made of molecules flying about in mostly empty space, colliding with each other and with the walls of their container. Every collision with a wall gives it a tiny push. Billions of these pushes per second add up to the steady force we measure as pressure. The ideal gas law, PV = nRT, describes how that pressure depends on three other things:

    • The amount of gas, n. More molecules mean more collisions, so more pressure.
    • The temperature, T. Hotter molecules move faster and hit harder and more often, so more pressure.
    • The volume, V. In a bigger container each molecule reaches a wall less often, so less pressure.

    The law brings together four earlier discoveries. Robert Boyle found in 1662 that pressure and volume are inversely proportional. Jacques Charles and Joseph Gay-Lussac showed around 1787–1802 that volume rises in proportion to temperature. In 1811 Amedeo Avogadro proposed that equal volumes of gas contain equal numbers of molecules. In 1834 the French engineer Émile Clapeyron combined them into a single equation, which later took its modern form with the universal gas constant R.

    An "ideal" gas is a model in which the molecules take up no space and do not attract each other. Real gases come close to this when they are far from condensing: at low to moderate pressure and well above their boiling point. Air at room temperature and atmospheric pressure follows the ideal gas law to better than 0.1%.

    The formula explained

    PV = nRT
    SymbolQuantitySI unitMeaning
    PPressurePaAbsolute pressure of the gas
    VVolumem³Volume occupied by the gas
    nAmount of gasmolAmount of gas in moles
    TTemperatureKAbsolute temperature

    Use absolute pressure and absolute temperature. T must be in kelvin (°C + 273.15). P must be absolute pressure, not the "gauge" pressure read by a tyre gauge, which is measured relative to the atmosphere.

    Choose R to match your units. The gas constant has the same value in every system, expressed in different units:

    Value of RUse with
    8.314 J/(mol·K)P in Pa, V in m³ (SI)
    8.314 L·kPa/(mol·K)P in kPa, V in L
    0.08206 L·atm/(mol·K)P in atm, V in L
    62.36 L·Torr/(mol·K)P in Torr or mmHg, V in L

    The calculator converts every input to SI and uses R = 8.314462618 J/(mol·K), so you can mix units freely.

    Useful rearrangements. Writing n = m/M gives the gas density, ρ = PM/(RT), and lets you find the molar mass of an unknown gas from its measured density.

    Molar volume. One mole of ideal gas occupies 22.414 L at 0 °C and 1 atm, 22.711 L at 0 °C and 1 bar (the current IUPAC definition of STP), and 24.47 L at 25 °C and 1 atm.

    How to use this calculator

    1. Choose the quantity you want to find in the Calculate menu. It is highlighted as the result field.
    2. Enter the known values. Scientific notation such as 1.6e-11 is accepted.
    3. Select a unit for each value. Units are converted to SI automatically.
    4. The answer updates as you type. Open Show calculation steps to see the working, or use Copy result to share a link with your inputs.

    Step-by-step worked example

    Problem. (a) What pressure does 1.00 mol of gas exert in 22.414 L at 0 °C? (b) What is the density of air (M = 28.97 g/mol) at 25 °C and 1 atm? (c) How many moles of air does a 12 L scuba cylinder hold at 200 bar and 20 °C?

    Part (a)

    1. Convert to SI. T = 273.15 K and V = 0.022414 m³.
    2. Solve for P. P = nRT/V = 1.00 × 8.314 × 273.15 / 0.022414 = 101 325 Pa = 1.00 atm. This is the familiar molar volume at 0 °C and 1 atm.

    Part (b)

    1. Use ρ = PM/(RT), with M in kg/mol: 0.02897 kg/mol.
    2. ρ = 101 325 × 0.02897 / (8.314 × 298.15) = 1.18 kg/m³. A room of 50 m³ holds about 59 kg of air.

    Part (c)

    1. Convert to SI. P = 200 bar = 2.00 × 10⁷ Pa, V = 0.012 m³, T = 293.15 K.
    2. Solve for n. n = PV/(RT) = 2.00 × 10⁷ × 0.012 / (8.314 × 293.15) = 98 mol, about 2.9 kg of air.
    3. Check ideality. At 200 bar, real air is slightly less compressible than an ideal gas, so the true amount is a few per cent lower. For very high-pressure work, engineers apply a compressibility factor.

    Try it: the calculator's defaults reproduce part (a). For part (c), choose "Amount of gas (n)" in the Calculate menu.

    How to interpret the result

    • Compare with the molar volume. At everyday conditions one mole of any gas occupies roughly 22–25 L. If your answer implies one mole fits in a teacup at atmospheric pressure, check your units.
    • The identity of the gas does not matter. One mole of hydrogen and one mole of carbon dioxide occupy the same volume at the same T and P. Only the mass differs.
    • Proportional thinking. At fixed n and V, doubling the absolute temperature doubles the pressure. Going from 20 °C to 40 °C is only a 7% rise in absolute temperature, so the pressure rises by about 7%, not 100%.
    • Know when to stop trusting it. Deviations grow at high pressure (above roughly 10–50 bar for common gases), at low temperature, and near condensation. Steam close to its boiling point, refrigerants and compressed CO₂ need a real-gas equation such as van der Waals, or tabulated data.

    Real-world applications

    • Car airbags. An airbag must fill in a few hundredths of a second. Designers use the ideal gas law to work out how much gas-producing chemical is needed to fill a bag of a given volume at the required pressure.
    • Weather balloons. As a balloon rises, outside pressure falls and the gas inside expands. A balloon that leaves the ground at 1–2 m across can swell to several times that width before it bursts high in the stratosphere.
    • Diving and medical gases. The amount of breathable gas in a cylinder, and therefore how long it lasts, is calculated from its pressure, volume and temperature.
    • Chemical engineering. Reactor sizes, pipeline flows and gas storage tanks are all designed using the ideal gas law, with real-gas corrections at high pressure.
    • Finding molar mass. Measuring the mass of a known volume of gas at known T and P gives its molar mass. This classic method, the Dumas method, helped chemists establish atomic and molecular masses in the 19th century.

    Common mistakes and unit-conversion tips

    1. Using °C instead of K. At 0 °C the formula would predict zero pressure. Always add 273.15.
    2. Gauge instead of absolute pressure. A tyre reading of 220 kPa is about 321 kPa absolute. Add atmospheric pressure (≈ 101.3 kPa) first.
    3. Litres with R = 8.314 J/(mol·K). With that value of R, volume must be in m³ (1 L = 0.001 m³) and pressure in Pa. Using litres and pascals together gives an answer 1000 times off.
    4. Molar mass in g/mol in the density formula. In SI, M must be in kg/mol (28.97 g/mol = 0.02897 kg/mol).
    5. Mixing up STP definitions. Older textbooks use 0 °C and 1 atm (22.414 L/mol). IUPAC now uses 0 °C and 1 bar (22.711 L/mol). Some industries use other reference conditions. State which one you use.
    6. Applying it to liquids or near condensation. The ideal gas law does not describe liquids, and it becomes inaccurate for vapours close to condensing.

    Frequently asked questions

    Which value of R should I use?

    Any value works if the units match: 8.314 J/(mol·K) with Pa and m³, 0.08206 L·atm/(mol·K) with atm and L. The calculator handles this for you by converting everything to SI and using R = 8.314 J/(mol·K).

    Why must temperature be in kelvin?

    The law is proportional to absolute temperature. 0 °C is not "zero temperature", so Celsius values give wrong answers. Enter °C or °F if you like and the calculator converts them to kelvin.

    Should I use gauge or absolute pressure?

    Absolute pressure. Gauge pressure (for example from a tyre gauge) must have atmospheric pressure (≈101.3 kPa) added first.

    What is the molar volume of a gas at STP?

    At 0 °C and 1 atm, one mole of ideal gas occupies 22.414 L. At the current IUPAC standard of 0 °C and 1 bar it is 22.711 L. At 25 °C and 1 atm it is about 24.47 L.

    When is the ideal gas law not accurate?

    It becomes inaccurate at high pressures, at low temperatures and close to condensation, where molecular size and attractions matter. In those conditions use a real-gas equation such as the van der Waals equation, or measured data.

    Sources and further reading

    1. Clapeyron, É. (1834). Mémoire sur la puissance motrice de la chaleur. Journal de l'École Polytechnique, 14, 153–190.
    2. Atkins, P., de Paula, J., & Keeler, J. (2018). Atkins' Physical Chemistry (11th ed.). Oxford University Press. Chapter 1, The properties of gases.
    3. Petrucci, R. H., Herring, F. G., Madura, J. D., & Bissonnette, C. (2017). General Chemistry: Principles and Modern Applications (11th ed.). Pearson. Chapter 6, Gases.
    4. National Institute of Standards and Technology. CODATA value: molar gas constant. physics.nist.gov.