Home › Chemistry › 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
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
law | enum: boyle | charles | gay_lussac | combined | default combined | Which relation to apply; the combined law needs all three initial quantities and two of the final ones. | |
initial_pressure | number | no | Initial pressure in pressure_unit (not needed for Charles's law). Range: > 0 | |
initial_volume | number | no | Initial volume in any unit shared with final_volume (not needed for Gay-Lussac's law). Range: > 0 | |
initial_temperature | number | no | Initial temperature in temperature_unit (not needed for Boyle's law). | |
final_pressure | number | no | Final pressure in pressure_unit. Leave empty to solve for it. Range: > 0 | |
final_volume | number | no | Final volume, same unit as initial_volume. Leave empty to solve for it. Range: > 0 | |
final_temperature | number | no | Final temperature in temperature_unit. Leave empty to solve for it. | |
pressure_unit | enum: atm | kpa | bar | mmhg | psi | default atm | Unit of the pressure inputs (1 atm = 101.325 kPa = 1.01325 bar = 760 mmHg = 14.696 psi). | |
temperature_unit | enum: celsius | kelvin | default celsius | Unit of the temperature inputs; the calculation uses kelvin (K = °C + 273.15). |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
solved_for | string | final_pressure, final_volume or final_temperature. | |
law_used | string | Name and form of the relation applied. | |
final_pressure | number | P2 in the chosen pressure unit (pressure laws only). | |
final_pressure_atm | number | atm | P2 in standard atmospheres. |
final_pressure_kpa | number | kPa | P2 in kilopascals. |
final_volume | number | V2 in the unit of initial_volume (volume laws only). | |
final_temperature_k | number | K | T2 in kelvin (temperature laws only). |
final_temperature_c | number | °C | T2 in degrees Celsius. |
initial_temperature_k | number | K | T1 in kelvin, as used in the ratio. |
change_factor | number | Solved 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
- API:
GET https://tttkmbb.com/api/v1/calculate/gas-laws(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/gas-laws · Markdown: https://tttkmbb.com/chemistry/gas-laws.md · JSON definition: https://tttkmbb.com/chemistry/gas-laws.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="gas-laws" - OpenAPI operationId:
solve_gas_laws - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
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
- Ideal Gas Law Calculator — Solve PV = nRT when the amount of gas is involved.
- Pressure Converter — Convert pressures between Pa, bar, psi, atm and mmHg.
- Temperature Converter — Convert between Celsius, Fahrenheit and kelvin.