HomeChemistry › Ideal Gas Law Calculator

Ideal Gas Law Calculator

Solves the ideal gas equation PV = nRT for whichever of pressure, volume, amount or temperature is left empty, with pressure in atm, kPa, bar, mmHg or psi and temperature in °C, K or °F.

When to use

You know three of pressure, volume, moles and temperature of a gas and need the fourth, or the molar volume at given conditions.

Do not use when: The gas is near condensation or at very high pressure (use a real-gas equation such as van der Waals), or you need the mass of gas without knowing its molar mass (combine with moles-mass).

Formula

P × V = n × R × T with R = 0.082057366 L·atm/(mol·K) (= 8.314462618 J/(mol·K)); P converted to atm, T to kelvin (K = °C + 273.15)

Ideal-gas behaviour is accurate to about 1% for common gases near room temperature and pressures up to a few atmospheres; deviations grow near the boiling point and above roughly 10 atm.

Inputs

ParameterTypeUnitRequiredDescription
pressurenumbernoGas pressure in the unit given by pressure_unit. Leave empty to solve for it. Range: > 0
pressure_unitenum: atm | kpa | bar | mmhg | psidefault atmUnit of the pressure input (1 atm = 101.325 kPa = 1.01325 bar = 760 mmHg = 14.696 psi).
volume_lnumberLnoGas volume in litres. Leave empty to solve for it. Range: > 0
molesnumbermolnoAmount of gas in moles. Leave empty to solve for it. Range: > 0
temperaturenumbernoGas temperature in the unit given by temperature_unit (must be above absolute zero). Leave empty to solve for it. Range: ≥ -459.67, ≤ 10000000
temperature_unitenum: celsius | kelvin | fahrenheitdefault celsiusUnit of the temperature input; the calculation uses kelvin.

Outputs

OutputTypeUnitDescription
solved_forstringpressure, volume_l, moles or temperature.
pressure_atmnumberatmPressure in standard atmospheres.
pressure_kpanumberkPaPressure in kilopascals (1 atm = 101.325 kPa).
pressure_barnumberbarPressure in bar (1 atm = 1.01325 bar).
volume_lnumberLGas volume in litres.
molesnumbermolAmount of gas.
temperature_knumberKAbsolute temperature.
temperature_cnumber°CTemperature in degrees Celsius.
molar_volume_l_per_molnumberL/molV / n at these conditions (22.414 L/mol at 0 °C and 1 atm).

Example

Molar volume at 0 °C and 1 atm: {"pressure":1,"pressure_unit":"atm","moles":1,"temperature":0,"temperature_unit":"celsius"}{"solved_for":"volume_l","volume_l":22.414,"molar_volume_l_per_mol":22.414,"temperature_k":273.15,"pressure_kpa":101.325}

Moles in 5 L at 101.325 kPa and 25 °C: {"pressure":101.325,"pressure_unit":"kpa","volume_l":5,"temperature":25}{"solved_for":"moles","moles":0.20437,"pressure_atm":1,"temperature_k":298.15,"molar_volume_l_per_mol":24.4654}

GET https://tttkmbb.com/api/v1/calculate/ideal-gas-law?pressure=1&pressure_unit=atm&moles=1&temperature=0&temperature_unit=celsius

Machine access

Sources

FAQ

Why is the molar volume 22.414 L and not 22.7 L?

22.414 L/mol applies at 0 °C and 1 atm (101.325 kPa). IUPAC's current STP is 0 °C and 1 bar (100 kPa), which gives 22.711 L/mol; enter pressure 1 bar to reproduce it.

Can I enter temperature in Celsius?

Yes, temperature_unit defaults to celsius and the value is converted to kelvin internally; temperatures at or below absolute zero are rejected.

Related calculators