How to use the ideal gas law calculator
- Choose what to find: the pressure, the volume, the amount of gas or the temperature.
- Enter the other three with their units. Pick standard conditions from the list to fill in the pressure and temperature, or type your own.
- To give the amount as a mass, set “Amount given as” to mass and type the gas’s formula, such as CO2, or its molar mass.
- Read the answer in the unit you chose, with the same state in other units, the molar volume, the density when the formula is known, and every step.
- For a gas that changes from one state to another, use the combined gas law part below the calculator.
The ideal gas law
The ideal gas law links the pressure P, volume V, amount n and temperature T of a gas: PV = nRT, where R is the molar gas constant. Wikipedia describes it as the equation of state of a hypothetical ideal gas and adds: “It is a good approximation of the behavior of many gases under many conditions, although it has several limitations.” It combines four older laws found by experiment, named after Boyle, Charles, Avogadro and Gay-Lussac.
Solving the same equation for each quantity gives the four forms the calculator uses: P = nRT / V, V = nRT / P, n = PV / RT and T = PV / nR. With SI units, pressure in pascals, volume in cubic meters and temperature in kelvin, R is 8.314 462 618 J/(mol·K). NIST lists this value as exact: since 2019 the Avogadro constant and the Boltzmann constant are fixed numbers, and R is their product.
Temperature must be absolute
The temperature in the ideal gas law is an absolute temperature; in Wikipedia’s words, “the appropriate SI unit is the kelvin.” Absolute zero, 0 K, is “equivalent to −273.15 °C on the Celsius scale,” and no gas can be cooled to it or below. The calculator accepts °C, °F, K and °R, converts to kelvin first, and refuses temperatures at or below absolute zero.
The same applies to pressure: the equation uses the absolute pressure, the total pressure of the gas. A tire gauge shows the pressure above the air around it, so a tire reading 32 psi has an absolute pressure of about 46.7 psi at sea level.
Standard conditions and molar volume
Gas volumes are often quoted at standard conditions, and there is more than one standard. Wikipedia’s article on standard temperature and pressure explains that until 1982 STP was 273.15 K and 1 standard atmosphere: “Since 1982, STP has still been defined as a temperature of 273.15 K (0.00 °C; 32.00 °F) but defined with an absolute pressure of exactly 1 bar.” IUPAC also defines SATP, standard ambient temperature and pressure, and NIST uses 20 °C and 1 atm.
The calculator gives the molar volume of an ideal gas at each: 22.41 L/mol at 0 °C and 1 atm, 22.71 L/mol at 0 °C and 1 bar, 24.47 L/mol at 25 °C and 1 atm, and 24.06 L/mol at 20 °C and 1 atm. Quoting a gas volume without its conditions is meaningless, because the same amount of gas fills a different volume at each.
Using grams, formulas and density
In the lab you often know the mass of a gas rather than the number of moles. The amount is the mass divided by the molar mass, n = m / M, so the calculator lets you type the mass and the gas’s formula; it works out the molar mass from the CIAAW 2024 standard atomic weights. One liter of carbon dioxide at 25 °C and 1 atm holds 1.799 g of CO₂.
With a mass known, the calculator also gives the density, ρ = m / V = PM / RT. At 0 °C and 1 atm, 32 g of oxygen, O₂, fills 22.41 L, a density of 1.428 g/L. At the same pressure and temperature, the density is proportional to the molar mass, so gases with heavier molecules are denser.
The combined gas law
When a fixed amount of gas moves from one state to another, the amount drops out: P₁V₁ / T₁ = P₂V₂ / T₂. As Wikipedia’s ideal gas law article puts it: “Combining the laws of Charles, Boyle, and Gay-Lussac gives the combined gas law.” If one quantity stays constant, the combined law reduces to one of the classic laws, and the calculator says which.
- Boyle’s law, constant temperature: compressing 10 L of gas from 1 atm to 2 atm at 20 °C leaves 5 L.
- Charles’s law, constant pressure: warming 10 L at 1 atm from 20 °C to 80 °C expands it to 12.05 L.
- Gay-Lussac’s law, constant volume: a sealed, rigid container at 1 atm and 20 °C reaches 1.205 atm at 80 °C.
- All three change: 10 L at 1 atm and 20 °C, squeezed to 2 atm and warmed to 80 °C, takes up 6.023 L.
When the ideal gas law is not enough
Real molecules have a size and attract one another, which the ideal gas law ignores. Wikipedia notes that, for this reason, it “is most accurate for monatomic gases at high temperatures and low pressures,” and that more detailed equations of state, such as the van der Waals equation, “account for deviations from ideality caused by molecular size and intermolecular forces.” At very high pressures or low temperatures, treat the calculator’s answer as an estimate.
Common mistakes
- Using °C or °F directly in PV = nRT. Always convert to kelvin first; the calculator does it for you.
- Using gauge pressure from a tire or tank gauge instead of absolute pressure.
- Mixing units with the wrong value of R, such as liters and atmospheres with 8.314 J/(mol·K).
- Quoting a gas volume or molar volume without its temperature and pressure.
Your values stay on your device
Everything is worked out in your browser. Nothing you type is sent anywhere or stored.
Frequently asked questions
What is R in PV = nRT?
R is the molar gas constant, 8.314 462 618… J/(mol·K). Since the 2019 redefinition of the SI it is exact, because it is the product of two fixed constants, the Avogadro constant and the Boltzmann constant. In other units it is 0.082 057 L·atm/(mol·K) or 62.364 L·torr/(mol·K); the calculator converts all units for you.
Why must the temperature be in kelvin?
The ideal gas law needs an absolute temperature, one that starts at absolute zero. A gas at 20 °C is not “twice as hot” as one at 10 °C; in kelvin they are 293.15 K and 283.15 K. Enter °C or °F if you like: the calculator converts to kelvin before it uses the formula, and shows that step.
What volume does one mole of gas take up?
It depends on the conditions. An ideal gas occupies 22.414 L per mole at 0 °C and 1 atm, 22.711 L at 0 °C and 1 bar (today’s IUPAC STP), and about 24.47 L at 25 °C and 1 atm. Pick the conditions in the calculator to see the exact value.
Can I enter grams instead of moles?
Yes. Set “Amount given as” to mass, enter the mass and the gas’s formula, such as O2, CO2 or CH4, or its molar mass. The calculator converts the mass to moles and also gives the gas density.
Should I use gauge or absolute pressure?
Absolute pressure. A tire gauge or a pressure gauge on a tank reads the pressure above the surrounding air, so add the atmospheric pressure (about 1 atm, 101.3 kPa or 14.7 psi at sea level) before using the gas laws.
Is anything I type sent anywhere?
No. Everything is worked out in your browser and nothing you type is sent anywhere or stored.