HomeChemistry › Gas Laws Calculator

Gas Laws Calculator

Solves the one unknown final pressure, volume or temperature of a fixed amount of gas from its initial state using Boyle's law (P1V1 = P2V2), Charles's law (V1/T1 = V2/T2), Gay-Lussac's law (P1/T1 = P2/T2) or the combined gas law (P1V1/T1 = P2V2/T2).

When to use

A closed gas sample changes pressure, volume or temperature and you need the missing final quantity; temperatures may be entered in °C or K and pressures in atm, kPa, bar, mmHg or psi.

Do not use when: The amount of gas is unknown or changes, or you need moles or molar volume (use ideal-gas-law with PV = nRT); the gas is near condensation or above roughly 10 atm where ideal behaviour fails.

Formula

P1 × V1 / T1 = P2 × V2 / T2 with T in kelvin; Boyle drops T, Charles drops P, Gay-Lussac drops V. Solve: P2 = P1V1T2/(V2T1), V2 = P1V1T2/(P2T1), T2 = T1P2V2/(P1V1)

Ratios are unit-independent, so pressure and volume come out in the units entered; temperatures must be absolute, which is why °C inputs are converted to kelvin before dividing. Amount of gas is assumed constant and the gas ideal.

Inputs

ParameterTypeUnitRequiredDescription
lawenum: boyle | charles | gay_lussac | combineddefault combinedWhich relation to apply; the combined law needs all three initial quantities and two of the final ones.
initial_pressurenumbernoInitial pressure in pressure_unit (not needed for Charles's law). Range: > 0
initial_volumenumbernoInitial volume in any unit shared with final_volume (not needed for Gay-Lussac's law). Range: > 0
initial_temperaturenumbernoInitial temperature in temperature_unit (not needed for Boyle's law).
final_pressurenumbernoFinal pressure in pressure_unit. Leave empty to solve for it. Range: > 0
final_volumenumbernoFinal volume, same unit as initial_volume. Leave empty to solve for it. Range: > 0
final_temperaturenumbernoFinal temperature in temperature_unit. Leave empty to solve for it.
pressure_unitenum: atm | kpa | bar | mmhg | psidefault atmUnit of the pressure inputs (1 atm = 101.325 kPa = 1.01325 bar = 760 mmHg = 14.696 psi).
temperature_unitenum: celsius | kelvindefault celsiusUnit of the temperature inputs; the calculation uses kelvin (K = °C + 273.15).

Outputs

OutputTypeUnitDescription
solved_forstringfinal_pressure, final_volume or final_temperature.
law_usedstringName and form of the relation applied.
final_pressurenumberP2 in the chosen pressure unit (pressure laws only).
final_pressure_atmnumberatmP2 in standard atmospheres.
final_pressure_kpanumberkPaP2 in kilopascals.
final_volumenumberV2 in the unit of initial_volume (volume laws only).
final_temperature_knumberKT2 in kelvin (temperature laws only).
final_temperature_cnumber°CT2 in degrees Celsius.
initial_temperature_knumberKT1 in kelvin, as used in the ratio.
change_factornumberSolved final value divided by its initial value.

Example

Boyle: 2.0 L at 760 mmHg compressed to 0.5 L: {"law":"boyle","initial_pressure":760,"initial_volume":2,"final_volume":0.5,"pressure_unit":"mmhg"}{"solved_for":"final_pressure","final_pressure":3040,"final_pressure_atm":4,"final_pressure_kpa":405.3,"change_factor":4}

Combined: 10 L at 1 atm, 25 °C to 2 atm, 100 °C: {"law":"combined","initial_pressure":1,"initial_volume":10,"initial_temperature":25,"final_pressure":2,"final_temperature":100}{"solved_for":"final_volume","final_volume":6.2578,"final_temperature_k":373.15,"initial_temperature_k":298.15,"change_factor":0.62578}

GET https://tttkmbb.com/api/v1/calculate/gas-laws?law=boyle&initial_pressure=760&initial_volume=2&final_volume=0.5&pressure_unit=mmhg

Machine access

Sources

FAQ

Why must temperature be in kelvin?

The gas laws are proportionalities to absolute temperature: doubling 25 °C to 50 °C raises T only from 298 K to 323 K (8%), not 100%. Enter °C and the calculator converts, or set temperature_unit=kelvin.

Which inputs does each law need?

Boyle: P1, V1 and one of P2/V2. Charles: V1, T1 and one of V2/T2. Gay-Lussac: P1, T1 and one of P2/T2. Combined: P1, V1, T1 and two of P2/V2/T2. Inputs irrelevant to the chosen law are ignored.

Related calculators