About this tool
The ideal gas law links the pressure, volume, temperature and amount of a gas in one equation. It combines Boyle's law (pressure and volume), Charles's law (volume and temperature) and Avogadro's law (volume and amount), and describes most gases well at everyday temperatures and pressures.
It is used to find how much gas a cylinder holds, the volume a reaction produces, the pressure in a sealed container after heating, or the molar volume at standard conditions.
How it works
Choose the quantity to solve for and enter the other three. Pressure can be in Pa, kPa, bar, atm, mmHg or psi, volume in L, mL, m³ or ft³, the amount in mol or mmol, and temperature in kelvins, degrees Celsius or degrees Fahrenheit. The preset list fills in the temperature and pressure of standard conditions.
The calculator keeps your pressure and volume units and expresses the gas constant in the same units, for example L·atm/(mol·K) or L·kPa/(mol·K). Temperatures are always converted to kelvins before they go into , because the law needs an absolute temperature. The steps show the rearranged formula, the substituted values and the molar volume of the gas.
Example
One mole of gas at 273.15 K and 1 atm occupies L, the classic molar volume at STP.
A 2 L flask at 25 °C and 200 kPa holds mol of gas. Note that 25 °C was converted to 298.15 K first.
Standard conditions and the gas constant
Molar volume of an ideal gas at reference conditions
| Conditions | Temperature (K) | Temperature (°C) | Pressure (kPa) | Molar volume (L/mol) |
|---|---|---|---|---|
| STP (IUPAC) | 273.15 | 0 | 100 | 22.711 |
| STP (1 atm, older definition) | 273.15 | 0 | 101.325 | 22.414 |
| SATP | 298.15 | 25 | 100 | 24.790 |
| NTP | 293.15 | 20 | 101.325 | 24.055 |
The gas constant R in common units
| Units | Value |
|---|---|
| J/(mol·K) | 8.314462618 |
| L·kPa/(mol·K) | 8.314462618 |
| L·bar/(mol·K) | 0.08314463 |
| L·atm/(mol·K) | 0.08205737 |
| L·mmHg/(mol·K) | 62.36359 |
| ft³·psi/(mol·K) | 0.04258634 |
R is the Avogadro constant times the Boltzmann constant, both exact since the 2019 redefinition of the SI. STP is 0 °C and 100 kPa (IUPAC since 1982); many textbooks still use 0 °C and 1 atm. SATP is 25 °C and 100 kPa, and NTP is 20 °C and 1 atm.
Assumptions and limits
Real gases follow the ideal gas law closely when the pressure is low and the temperature is well above the boiling point. At high pressure, or close to condensation, molecules attract each other and take up space, and the van der Waals or another real-gas equation is more accurate. Water vapor near saturation and gases such as carbon dioxide at high pressure deviate noticeably.
The calculator treats the gas as a pure ideal gas. For mixtures, n is the total amount of all components, and each component's partial pressure follows the same law.
Frequently asked questions
What is the ideal gas law?
It is the equation of state : pressure times volume equals the amount of gas times the gas constant times the absolute temperature.
What value of R should I use?
R is 8.314 462 618 J/(mol·K), which is the same as kPa·L/(mol·K). With atmospheres and liters it is 0.082057 L·atm/(mol·K), and with mmHg 62.364 L·mmHg/(mol·K). The calculator picks the value that matches your units.
Why must the temperature be in kelvins?
The law is proportional to absolute temperature, which starts at absolute zero. A temperature in degrees Celsius or Fahrenheit has an arbitrary zero, so doubling 10 °C does not double the volume, while doubling 283.15 K does.
What is the molar volume at STP?
At the IUPAC standard temperature and pressure, 0 °C and 100 kPa, one mole of ideal gas occupies 22.711 L. With the older 1 atm definition it is 22.414 L, and at SATP (25 °C, 100 kPa) it is 24.790 L.
When does the ideal gas law not work?
It becomes inaccurate at high pressures, at low temperatures near condensation and for strongly interacting gases. Use a real-gas equation such as van der Waals for those conditions.
Link with your values
Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.
| Parameter | Value | If omitted |
|---|---|---|
solve_for | what to calculate: pressure, volume, amount, temperature; give the other 3 values | default volume |
conditionFill in standard conditions | one of: stp, stp_atm, satp, ntp | optional |
pressure_atmPressure (P) | number; any unit in the name: _pa, _kpa, _bar, _atm, _mmhg, _psi; allowed > 0 atm | give 3 of pressure_atm, volume_l, amount_mol, temperature_k |
volume_lVolume (V) | number; any unit in the name: _ml, _l, _m3, _tsp, _tbsp, _fl_oz, _fl_oz_uk, _cup, _pt, _qt, _gal, _gal_uk, _in3, _ft3, _yd3, _ul, _cm3; allowed > 0 l | give 3 of pressure_atm, volume_l, amount_mol, temperature_k |
amount_molAmount of gas (n) | number; any unit in the name: _mol, _mmol, _umol; allowed > 0 mol | give 3 of pressure_atm, volume_l, amount_mol, temperature_k |
temperature_kTemperature (T) | number; any unit in the name: _c, _f, _k; allowed > 0 k | give 3 of pressure_atm, volume_l, amount_mol, temperature_k |
Examples
?solve_for=volume&pressure_atm=1&amount_mol=2&temperature_c=25?condition=stp&amount_mol=0.5?solve_for=pressure&volume_l=10&amount_mol=1&temperature_k=300
Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.
Result elements: [data-result-block="ideal_gas_law_calculator"]