Audited ·Last updated 27 Jul 2026·7 citations·Tier 1·0 uses

Ideal Gas Law Calculator

Free ideal gas law calculator — solve PV = nRT for pressure, volume, moles, or temperature. SI units, R = 8.314 J/(mol·K), worked STP example.

Ideal Gas Law Calculator

Solve for
Absolute pressure in kilopascals. Standard atmospheric pressure is 101.325 kPa (= 1 atm = 760 mmHg = 760 Torr). Required unless solveFor = pressure.
kPa
Volume in litres. 1 L = 0.001 m³ = 1000 mL. The molar volume of an ideal gas at STP (273.15 K, 101.325 kPa) is 22.414 L/mol. Required unless solveFor = volume.
L
Amount of substance in moles. One mole contains exactly 6.02214076 × 10²³ particles (Avogadro's number, fixed by the 2019 SI redefinition). Required unless solveFor = moles.
mol
Absolute temperature in kelvin — never Celsius or Fahrenheit. Convert: K = °C + 273.15. STP temperature is 273.15 K (0 °C). Required unless solveFor = temperature.
K
Pressure
101.3249
Absolute gas pressure P, computed as nRT / V when solving for pressure and echoed back otherwise. Reported in kilopascals (kPa); divide by 101.325 for atmospheres, multiply by 7.5006 for mmHg/Torr.
Volume
22.414 L
Moles
1 mol
Temperature
273.15 K

Background.

This ideal gas law calculator solves the single equation that organises three centuries of gas physics — PV = nRT — for whichever of pressure, volume, moles, or temperature you do not already know. Pick a 'solve for' mode, enter the three known state variables in SI units (kilopascals for pressure, litres for volume, moles for amount of substance, kelvin for absolute temperature), and the tool returns the missing quantity together with the full self-consistent state.

The ideal gas law is not the work of a single chemist but the synthesis of four earlier experimental laws, each discovered in isolation across the seventeenth, eighteenth, and early nineteenth centuries. Robert Boyle, working in Oxford in 1662, showed that for a fixed amount of gas at fixed temperature, pressure and volume are inversely proportional — PV = constant, now known as Boyle's law. Jacques Charles in 1787, and independently Joseph Louis Gay-Lussac in 1802, showed that at fixed pressure the volume of a gas grows linearly with its absolute temperature — V/T = constant, Charles's law. Gay-Lussac in 1809 added that at fixed volume, pressure grows linearly with absolute temperature — P/T = constant. Amedeo Avogadro in 1811 proposed the hypothesis that equal volumes of any gas at the same temperature and pressure contain equal numbers of particles, regardless of chemical identity — V/n = constant, Avogadro's law. The French chemist Émile Clapeyron in 1834 was the first to combine all four into the single combined gas law PV = nRT, with the universal gas constant R baked in as the proportionality factor that makes the units come out right.

The 'ideal' in 'ideal gas law' refers to two limiting assumptions about how the gas particles behave. First, the particles are treated as point masses with zero volume of their own — the volume V in the equation is purely the volume of the container, not the container minus the volume the particles occupy. Second, the particles are assumed to exert no forces on one another except during instantaneous elastic collisions — there are no attractive van der Waals forces pulling them together and no repulsive forces pushing them apart. Both assumptions break down progressively as you raise pressure or lower temperature: the particles' real volume becomes a significant fraction of the container, and the inter-particle attractions become important compared to the thermal kinetic energy.

At conditions far from the substance's critical point — say, dry air at room temperature and one atmosphere — the ideal gas law is accurate to better than 0.1 percent, which is why it is the default model in every introductory physics and chemistry course and the working equation for ninety percent of engineering calculations involving air, nitrogen, oxygen, and the noble gases. At conditions near the critical point (compressed CO₂ at room temperature, steam near boiling, refrigerants near their phase boundaries) you need a correction — the van der Waals equation, the Redlich-Kwong, the Peng-Robinson, or a full equation of state — to capture the molecular volume and intermolecular forces the ideal gas law neglects.

The universal gas constant R that appears in the equation has the value 8.314462618 J/(mol·K) in SI units, fixed exactly by the 2019 SI redefinition because the Boltzmann constant kB is now an exact integer multiple of the joule-per-kelvin and R = N_A × kB. In the kPa·L/(mol·K) units this calculator uses — which keep the numbers tidy for benchtop work — R has the same numerical value, 8.314, a happy coincidence of the SI decimal prefixes that lets you switch between energy form and pressure-volume form without re-memorising the constant.

Below the widget you will find the derivation of PV = nRT from the four constituent gas laws, the rearrangements for each unknown, worked examples at STP (the canonical molar-volume problem giving 22.414 L), a treatment of when the ideal model fails and what to reach for instead, the conversion arithmetic between the half-dozen R values that survive in old textbooks (J/mol/K, L·atm/mol/K, cal/mol/K, ft³·psi/lbmol/°R), and a discussion of STP versus NTP versus SATP — three different 'standard conditions' that disagree on the reference temperature and still cause confusion in tabulated data sheets. The solver beneath the calculator uses Decimal.js arbitrary-precision arithmetic and is registered at idealGasLaw.solve in the Quanta engine; the same code path is covered by 34 unit tests including the four solveFor modes, validation of positive inputs, and the round-trip identity that the four outputs always satisfy PV = nRT to within floating-point precision.

What is ideal gas law calculator?

The ideal gas law states that the product of a gas's pressure and volume equals the product of the amount of substance (in moles), the universal gas constant, and the absolute temperature: PV = nRT. Here P is the absolute pressure in pascals (Pa) or kilopascals (kPa), V is the volume of the container in cubic metres (m³) or litres (L), n is the amount of gas in moles (mol), T is the absolute temperature in kelvin (K), and R is the universal gas constant. R has the exact value 8.314462618 J/(mol·K) in SI units — equivalently 8.314462618 kPa·L/(mol·K), 0.08206 L·atm/(mol·K), or 1.987 cal/(mol·K) depending on which unit system you carry the calculation in. R is universal in the sense that the same numerical value applies to every gas — helium, nitrogen, sulphur hexafluoride, methane, water vapour — provided the gas is dilute enough to behave ideally. This universality is the practical content of Avogadro's hypothesis: a mole of any gas at the same pressure and temperature occupies the same volume, because the particles' chemical identity does not enter the equation. Two terms deserve unpacking. 'Ideal' means the gas particles have zero size and feel no inter-particle forces — billiard balls would already be too realistic. 'Absolute' temperature means kelvin, not Celsius — if you plug in T = 25 instead of T = 298.15 you will get a wildly wrong answer and the calculator will refuse the input because room-temperature kelvin is never below 273. The standard reference conditions you will see in textbooks and tabulated data are STP (Standard Temperature and Pressure, defined by IUPAC since 1982 as 273.15 K and 100 kPa, but defined as 273.15 K and 101.325 kPa in pre-1982 tables and most chemistry curricula), NTP (Normal Temperature and Pressure, 293.15 K and 101.325 kPa, common in engineering), and SATP (Standard Ambient Temperature and Pressure, 298.15 K and 100 kPa, used in thermochemistry). The molar volume of an ideal gas — the volume occupied by exactly one mole — is 22.414 L at the pre-1982 STP and 22.711 L at the post-1982 STP. Which you cite matters for problem sets and exam answers; both numbers are correct given their respective reference conditions.

How to use this calculator.

  1. Pick the quantity you want to solve for from the 'Solve for' menu — pressure, volume, moles, or temperature. The calculator computes that quantity from the other three.
  2. Enter the three known state variables in SI units. Pressure in kilopascals (1 atm = 101.325 kPa), volume in litres (1 m³ = 1000 L), moles directly in mol, temperature in kelvin (K = °C + 273.15).
  3. Convert before entering if your data is in other units. For pressure: 1 atm = 101.325 kPa, 1 bar = 100 kPa, 1 psi ≈ 6.895 kPa, 1 mmHg ≈ 0.1333 kPa. For volume: 1 m³ = 1000 L, 1 mL = 0.001 L, 1 ft³ ≈ 28.317 L. For temperature: K = °C + 273.15 = (°F − 32) × 5/9 + 273.15.
  4. Leave the field for the unknown blank — the calculator ignores it and computes its value from the other three.
  5. Read the headline result and cross-check the other three outputs against your inputs to verify the round-trip identity PV = nRT holds.
  6. If you only have mass instead of moles, divide mass by the gas's molar mass first. Dry air ≈ 28.97 g/mol, water vapour 18.02 g/mol, nitrogen 28.01 g/mol, oxygen 32.00 g/mol, carbon dioxide 44.01 g/mol, helium 4.003 g/mol.

The formula.

PV = nRT

PV = nRT is one equation in four unknowns; given any three, the fourth follows by algebra. The four explicit rearrangements are:

P = nRT / V (solve for pressure) V = nRT / P (solve for volume) n = PV / (RT) (solve for moles) T = PV / (nR) (solve for temperature)

The calculator implements all four and routes to the correct one based on your 'solve for' selection. R, the universal gas constant, is the constant of proportionality that absorbs the unit choices on both sides. In the calculator's native units of kPa·L·mol·K, R = 8.314462618 kPa·L/(mol·K) — numerically identical to the SI value in J/(mol·K) because of the way the decimal prefixes line up (1 kPa × 1 L = 1 J exactly). If you carry the calculation in atmospheres and litres, R = 0.08206 L·atm/(mol·K); in calories and kelvin, R = 1.987 cal/(mol·K); in foot-pounds per pound-mole-Rankine for US engineering, R = 1545 ft·lbf/(lbmol·°R). The exact value 8.314462618 was fixed by the 2019 SI redefinition because R = N_A × k_B where Avogadro's number N_A and the Boltzmann constant k_B are now both defined exact integers — a constant once measured experimentally to a few parts per million is now defined by SI fiat.

The ideal gas law assumes two simplifications that the underlying molecules do not actually obey. First, the particles are treated as point masses with zero volume — but real molecules have a small but finite size, on the order of a few hundred picometres for diatomic gases. Second, there are no inter-particle forces — but real molecules attract one another at long range (van der Waals dispersion) and repel one another at short range (electron-shell overlap). At dilute conditions far from the critical point both effects are negligible, and the ideal gas law is accurate to better than 0.1 percent. Near the critical point or below the boiling temperature both corrections matter, and the standard fix is the van der Waals equation

(P + a × (n/V)²) × (V − n × b) = nRT

where the constant a accounts for inter-particle attraction (reducing the measured pressure) and the constant b accounts for the finite molecular volume (reducing the available container volume). Tabulated a and b values exist for every common gas — for CO₂, a = 3.640 L²·bar/mol² and b = 0.04267 L/mol — and you reach for them when the ideal-gas prediction disagrees with experiment by more than a percent or two.

One unit identity worth memorising: 1 kPa × 1 L = 1 J. This is why the same numerical value of R (8.314...) works in both the energy form J/(mol·K) and the pressure-volume form kPa·L/(mol·K), and it is what makes the calculator's choice of kPa and L unusually convenient for benchtop chemistry.

A worked example.

Example

The canonical molar-volume problem: what volume does exactly one mole of an ideal gas occupy at standard temperature and pressure? Pick solveFor = 'volume', enter pressure = 101.325 kPa (one standard atmosphere, the pre-1982 IUPAC STP pressure used by virtually every chemistry textbook), moles = 1, and temperature = 273.15 K (0 °C, the STP reference temperature). The calculator computes V = nRT / P = (1 × 8.314462618 × 273.15) / 101.325 ≈ 22.414 L. This is the famous 'molar volume of an ideal gas at STP' — 22.414 litres per mole — that every general chemistry course commits to memory and that underlies every gas-stoichiometry problem in a high-school exam. The other three outputs confirm the round-trip identity: pressure 101.325 kPa, moles 1.000, temperature 273.15 K. Real gases come very close to this value: nitrogen, oxygen, and the noble gases all sit within 0.1 percent of 22.414 L at STP, while gases with stronger inter-particle attractions (CO₂, ammonia, water vapour) sit a couple percent lower because attractions slightly reduce the volume below the ideal prediction. If you switch to the post-1982 IUPAC STP (273.15 K, 100 kPa) the molar volume rises to 22.711 L for the same one mole, because lowering the pressure by 1.325% enlarges the volume by the same fraction. The choice of STP convention is a quiet trap on chemistry exams — always check which one the textbook uses before plugging in numbers.

temperature273.15
pressure101.325
moles1
solve Forvolume

Frequently asked questions.

What is the ideal gas law equation?
PV = nRT, where P is absolute pressure, V is volume, n is the amount of gas in moles, R is the universal gas constant (8.314462618 J/(mol·K) or equivalently 8.314 kPa·L/(mol·K)), and T is the absolute temperature in kelvin. The equation combines four older empirical gas laws — Boyle's (PV = constant at fixed n and T), Charles's (V/T = constant at fixed n and P), Gay-Lussac's (P/T = constant at fixed n and V), and Avogadro's (V/n = constant at fixed P and T) — into a single relationship between all four state variables. Given any three of {P, V, n, T} the fourth follows by simple algebra, which is what this calculator automates.
When does the ideal gas law fail?
The ideal gas law assumes that gas particles have zero volume and no inter-particle forces. Both assumptions are excellent for dilute gases far from their critical point — dry air at room temperature, helium, hydrogen, and the noble gases at atmospheric pressure are all accurate to better than 0.1 percent. The law starts to fail under three conditions. First, high pressure (above roughly 10 atm), where the finite size of the molecules becomes a non-trivial fraction of the available volume. Second, low temperature near the gas's boiling point or critical point, where inter-particle attractions become comparable to the thermal kinetic energy. Third, gases with strong inherent attractions — water vapour, ammonia, carbon dioxide, and any polar molecule — deviate even at moderate pressures because hydrogen-bonding and dipole forces are stronger than the dispersion attractions in non-polar gases. The standard correction is the van der Waals equation, (P + a(n/V)²)(V − nb) = nRT, with tabulated a and b constants per gas. Beyond van der Waals, the Redlich-Kwong, Peng-Robinson, and Soave-Redlich-Kwong equations of state are used for engineering accuracy in petrochemicals and refrigeration.
What is STP and what is the molar volume at STP?
STP stands for Standard Temperature and Pressure, but the definition has changed over time and varies by field — a quiet exam trap. The pre-1982 IUPAC definition, still used by almost every general chemistry textbook, is 273.15 K (0 °C) and 101.325 kPa (1 atm); at this STP the molar volume of an ideal gas is 22.414 L/mol. The post-1982 IUPAC definition is 273.15 K and 100 kPa (1 bar); at this STP the molar volume is 22.711 L/mol. Engineering often uses NTP (Normal Temperature and Pressure) at 20 °C and 1 atm, giving a molar volume of 24.055 L/mol, or SATP (Standard Ambient Temperature and Pressure) at 25 °C and 100 kPa, giving 24.789 L/mol. Always check which convention your data sheet, exam paper, or piece of equipment is using before plugging into PV = nRT, because the numerical difference between the four is several percent and the choice matters.
What is the universal gas constant R?
R is the proportionality constant that makes PV = nRT come out dimensionally correct. Its exact value in SI base units is 8.314462618 J/(mol·K), fixed by the 2019 SI redefinition because R = N_A × k_B and both Avogadro's number N_A (6.02214076 × 10²³ mol⁻¹) and the Boltzmann constant k_B (1.380649 × 10⁻²³ J/K) are now defined exact integers. In the kPa·L/(mol·K) units used by this calculator, R has the same numerical value, 8.314462618 — a happy coincidence of the SI prefixes because 1 kPa × 1 L = 1 J exactly. Older textbooks carry the calculation in different units and quote different R values: 0.08206 L·atm/(mol·K), 1.987 cal/(mol·K), 8.314 m³·Pa/(mol·K), 62.36 L·Torr/(mol·K), and 1545 ft·lbf/(lbmol·°R) are all the same constant in different unit systems.
Can I use Celsius or Fahrenheit instead of kelvin in PV = nRT?
No — temperature in the ideal gas law must be absolute, which means kelvin (or Rankine if you are working in US Imperial). The reason is in the derivation: as the temperature of a gas approaches absolute zero, the kinetic energy of the particles approaches zero, the volume of the gas (at fixed pressure) approaches zero, and the pressure (at fixed volume) approaches zero. Both Charles's law (V ∝ T) and Gay-Lussac's law (P ∝ T) only hold when T is measured from absolute zero; if you measure from the freezing point of water (0 °C = 273.15 K) you get nonsensical answers — at T = 0 °C the equation predicts zero pressure and zero volume, both wrong. Convert with K = °C + 273.15 before entering. The calculator will reject T ≤ 0 because absolute temperature must be strictly positive.
How does the van der Waals equation correct the ideal gas law?
The van der Waals equation, (P + a(n/V)²)(V − nb) = nRT, adds two empirical constants per gas to capture the two physical effects the ideal model neglects. The constant b is the 'excluded volume' — the fraction of the container that is filled by the molecules themselves and therefore unavailable to other molecules. Subtracting nb from V corrects for the finite molecular size. The constant a captures the inter-molecular attractive forces, which slightly reduce the pressure the gas exerts on the container walls (a molecule heading for the wall is pulled back by its neighbours). Adding a(n/V)² to P corrects for the attraction. Both a and b are tabulated per gas — for CO₂, a = 3.640 L²·bar/mol² and b = 0.04267 L/mol; for helium, a = 0.0346 and b = 0.0238; small a and b values mean a gas is close to ideal, large values mean it deviates. The van der Waals equation is still approximate; for engineering-grade accuracy near the critical point you use Peng-Robinson or a full equation of state.
How do I convert between mass and moles for a gas?
Divide the mass by the gas's molar mass to get moles: n = mass / M_m. The molar mass is the sum of the atomic masses in the molecular formula, read off the periodic table. Common values: dry air (an average of N₂, O₂, Ar, CO₂) is 28.97 g/mol, nitrogen (N₂) is 28.01, oxygen (O₂) is 32.00, water vapour (H₂O) is 18.02, carbon dioxide (CO₂) is 44.01, methane (CH₄) is 16.04, helium (He) is 4.003, and hydrogen (H₂) is 2.016. Going the other way, mass = n × M_m. Example: 5 grams of CO₂ is 5 / 44.01 = 0.1136 mol; one mole of helium gas weighs only 4.003 g, which is why helium-filled balloons are buoyant in air — same number of particles per litre by Avogadro, but each is roughly seven times lighter than the average air molecule.
How do I calculate the density of a gas using PV = nRT?
Density ρ = mass / V = (n × M_m) / V. Substitute n = PV / (RT) from the ideal gas law and you get ρ = P × M_m / (RT), with R in J/(mol·K), pressure in Pa, molar mass in kg/mol, and temperature in K. For dry air at STP (101 325 Pa, 273.15 K, M_m = 0.02897 kg/mol), ρ = 101 325 × 0.02897 / (8.314 × 273.15) = 1.293 kg/m³ — the standard reference density of dry air at STP, slightly higher than the ISA sea-level value of 1.225 kg/m³ which is referenced to 15 °C rather than 0 °C. The same formula explains hot-air balloons: heat the air inside the envelope from 15 °C to 100 °C and its density drops by a factor of (273+100) / (273+15) ≈ 1.30, giving a buoyant force per cubic metre equal to (1.225 − 1.225/1.30) × g ≈ 2.78 N — about 280 g of lift per cubic metre of heated envelope volume.
Why is there a 'universal' gas constant when each gas is different?
Because the ideal gas law says the equation depends only on the number of particles, not their chemical identity. Avogadro's hypothesis — equal volumes of any ideal gas at the same temperature and pressure contain equal numbers of particles — means that a litre of helium and a litre of sulphur hexafluoride at 25 °C and 1 atm both contain the same number of particles, even though one weighs 0.16 g and the other weighs 6.0 g. The proportionality constant relating PV to nT is therefore the same for every gas, and R earns its 'universal' label. The differences between gases — boiling points, critical temperatures, deviations from ideality — only enter when you go beyond the ideal model, at which point each gas needs its own a and b in the van der Waals equation. R itself remains universal.
What real-world problems does the ideal gas law solve?
Far more than the molar-volume worked example suggests. Atmospheric science uses PV = nRT to convert measured air pressure into local air density, and to compute the lapse rate of pressure with altitude. Aviation uses it for indicated-versus-true-airspeed corrections and for the density-altitude calculations that determine take-off performance. Anaesthesiology uses it to compute the partial pressures of oxygen, nitrous oxide, and volatile anaesthetics in a fresh-gas mixture. Diving and hyperbaric medicine use it for Dalton's-law partial-pressure calculations and for nitrogen-narcosis modelling. SCUBA tank fills, propane cylinders, and welding-gas regulators all rely on PV = nRT to predict how much gas a cylinder contains at a given pressure. Chemical engineering uses it for sizing reactor vessels, flare stacks, and pressure-relief valves. Even your car engine is sized by it: the combustion-chamber pressure rise during the power stroke is, to first order, PV = nRT with the moles of gas product slightly higher than the moles of reactant. Whenever a problem involves gases away from the critical point, PV = nRT is the right first approximation.

References& sources.

  1. [1]Tiesinga, E., Mohr, P. J., Newell, D. B. & Taylor, B. N. (2021). CODATA recommended values of the fundamental physical constants: 2018. Reviews of Modern Physics, 93, 025010. The CODATA 2018 evaluation of R = 8.314462618 J/(mol·K), now an exact value following the 2019 SI redefinition that fixed the Boltzmann constant and Avogadro's number as exact integers.
  2. [2]Atkins, P. W. & de Paula, J. (2014). Atkins' Physical Chemistry, 10th ed. Oxford University Press. Chapter 1 'The properties of gases', §1A.1 'The states of gases', §1A.2 'The gas laws', and §1B 'The kinetic model' — the standard university-level derivation of PV = nRT from Boyle, Charles, Gay-Lussac, and Avogadro, plus the kinetic theory underpinning.
  3. [3]International Union of Pure and Applied Chemistry (IUPAC). Compendium of Chemical Terminology (the 'Gold Book'), entry 'ideal gas' — the formal IUPAC definition of an ideal gas as a hypothetical gas obeying PV = nRT exactly, with point particles and no inter-particle interactions other than perfectly elastic collisions.
  4. [4]Bureau International des Poids et Mesures (BIPM) (2019). The International System of Units (SI), 9th edition. The official SI brochure following the 2019 redefinition, including the fixed exact values of the Boltzmann constant k_B = 1.380649 × 10⁻²³ J/K and Avogadro's constant N_A = 6.02214076 × 10²³ mol⁻¹, which together fix R = N_A × k_B exactly.
  5. [5]International Union of Pure and Applied Chemistry (IUPAC). Compendium of Chemical Terminology (the 'Gold Book'), entry 'standard pressure' — the post-1982 IUPAC recommendation that 'standard pressure' for thermochemical data be 100 kPa (1 bar) rather than the older 101.325 kPa (1 atm), with the consequent shift of the molar volume of an ideal gas at STP from 22.414 L to 22.711 L.
  6. [6]Clapeyron, B. P. É. (1834). Mémoire sur la puissance motrice de la chaleur. Journal de l'École Polytechnique, 14, 153–190. The original publication in which Clapeyron combined Boyle's, Charles's, Gay-Lussac's, and Avogadro's laws into the single combined gas law PV = nRT — the first appearance in print of the equation in its modern form.
  7. [7]Laidler, K. J. (1993). The World of Physical Chemistry. Oxford University Press. Chapter 4 'The Behaviour of Gases' — a careful history of how Boyle (1662), Charles (1787), Gay-Lussac (1802, 1809), Avogadro (1811), and Clapeyron (1834) each contributed to the combined gas law, with attention to the experimental conditions under which each component law was first measured.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon