# Gas Law Calculator

Solve pressure, volume, temperature, or moles with the Ideal Gas Law (PV=nRT) or Combined Gas Law; also gas density and molar mass.

> Canonical page: https://elysiatools.com/en/tools/gas-law-calculator

- **Category:** Math & Numbers

- **Keywords:** gas law, ideal gas, pv=nrt, combined gas law, thermodynamics, chemistry

## Overview

The Gas Law Calculator is a versatile thermodynamics tool designed to solve for unknown variables in gas behavior equations. It supports calculations using the Ideal Gas Law (PV=nRT), the Combined Gas Law (P1V1/T1 = P2V2/T2), and gas density or molar mass derivations, with flexible units for the gas constant (R) and temperature.

## Inputs

- **Calculation Mode** (select)
- **Gas Constant (R) Units** (select): Determines the pressure/volume units you must enter. Temperature is always converted to Kelvin internally.
- **Temperature Unit** (select)
- **Pressure (P)** (number): Leave blank to solve for pressure in Ideal mode.
- **Volume (V)** (number): Leave blank to solve for volume in Ideal mode.
- **Temperature (T)** (number): Leave blank to solve for temperature in Ideal mode.
- **Moles (n)** (number): Leave blank to solve for moles in Ideal mode.
- **Initial Pressure (P1)** (number): e.g. 1
- **Initial Volume (V1)** (number): e.g. 1
- **Initial Temperature (T1)** (number): e.g. 273.15
- **Final Pressure (P2)** (number): e.g. 2
- **Final Volume (V2)** (number): e.g. 0.5
- **Final Temperature (T2)** (number): e.g. 546.3
- **Molar Mass (g/mol)** (number): e.g. 28.97 for air
- **Mass of gas (g)** (number): e.g. 2
- **Decimal Places** (number)

## When to use

- When you need to find a single missing variable (pressure, volume, temperature, or moles) for an ideal gas under specific conditions.
- When analyzing a gas sample undergoing changes in pressure, volume, or temperature to determine its final state.
- When calculating the density or molar mass of a gas given its mass, temperature, and pressure.

## How it works

- Select the calculation mode: Ideal Gas Law, Combined Gas Law, or Density/Molar Mass.
- Choose your preferred Gas Constant (R) unit and Temperature unit (Kelvin or Celsius).
- Enter the known parameters, leaving the target variable blank if using the Ideal Gas Law mode.
- Click calculate to compute the missing value, rounded to your specified decimal places.

## Use cases

- Chemistry students verifying homework solutions for ideal gas volume or pressure calculations.
- Laboratory technicians determining the required volume of a gas cylinder at a specific pressure and temperature.
- Process engineers calculating gas density changes under varying thermal and pressure conditions.

## Frequently asked questions

### What gas constant (R) units are supported?

The calculator supports L·atm/mol·K, J/mol·K, m³·Pa/mol·K, L·kPa/mol·K, cal/mol·K, and cm³·mmHg/mol·K.

### Can I input temperatures in Celsius?

Yes, you can select Celsius or Kelvin; the tool automatically converts Celsius to Kelvin internally for calculations.

### How do I solve for a variable in the Ideal Gas Law mode?

Simply fill in the three known variables and leave the field for the unknown variable blank.

### What does the Combined Gas Law mode calculate?

It solves for any single unknown initial or final state variable (P1, V1, T1, P2, V2, T2) when a gas changes state.

### Can this tool calculate gas density?

Yes, by selecting the Density / Molar Mass mode and entering the mass, molar mass, pressure, and temperature.

## Related tools

- [Active Earth Pressure (Rankine)](https://elysiatools.com/en/tools/active-earth-pressure): Calculate the Rankine active earth pressure on a smooth vertical wall backfilled with cohesionless soil. K_a = tan²(45°−φ/2). Optional uniform surcharge q. Returns the base pressure p₀, the total force P, and the resultant height.
- [RLC Admittance Calculator (Y = G + jB)](https://elysiatools.com/en/tools/admittance-calculator): Compute complex admittance Y = 1/Z = G + jB for series or parallel RLC circuits: G = R/|Z|², B = −X/|Z|². Returns conductance, susceptance, magnitude and phase angle. Supports any subset of R/L/C.
- [Bearing Capacity Calculator (Terzaghi)](https://elysiatools.com/en/tools/bearing-capacity-calculator): Calculate the Terzaghi ultimate bearing capacity of a shallow foundation: q_ult = c·Nc·sc + q·Nq·sq + 0.5·γ·B·Nγ·sγ. Computes Nc/Nq/Nγ and shape factors automatically; supports strip, square, and circular footings. Result in kPa.
- [Belt Pulley Speed Ratio Calculator](https://elysiatools.com/en/tools/belt-pulley-speed-ratio): Calculate the ratio, driven speed and belt linear speed of a belt drive. i = d₂/d₁ = n₁/n₂, belt speed v = π·d·n/60. Supports mm/cm/m/inch diameter units.
- [Bending Stress Calculator](https://elysiatools.com/en/tools/bending-stress-calculator): Calculate the maximum bending (flexural) stress σ_max = M·c/I = M/Z at the outermost fiber of a beam section. Supports solid circle, rectangle, hollow tube, and I-beam; computes I, section modulus Z, and distance c automatically. Stress in MPa.
- [Break-Even Calculator](https://elysiatools.com/en/tools/break-even-calculator): Calculate the break-even point for a product or business based on fixed costs, variable costs, and price
- [Cantilever Beam Calculator](https://elysiatools.com/en/tools/cantilever-beam-calculator): Calculate the maximum bending moment M_max, maximum shear force V_max and free-end deflection δ_max of a cantilever beam under a free-end point load P or a uniformly distributed load q. Point load: δ = PL³/(3EI); UDL: δ = qL⁴/(8EI).
- [Column Buckling Load Calculator (Euler)](https://elysiatools.com/en/tools/column-buckling-load): Calculate the Euler critical buckling load of an axially loaded column: P_cr = π²·E·I/(K·L)². Supports pinned-pinned (K=1), fixed-free (K=2), fixed-pinned (K=0.7), fixed-fixed (K=0.5). Returns effective length, radius of gyration, slenderness ratio λ, and critical stress σ_cr.

## Samples

- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Web Image Processing Rust Samples](https://elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion
