Thermodynamics

Ideal Gas Law Calculator — Pressure, Volume, Amount of Substance and Temperature Solver

Calculate pressure, volume, amount of substance or temperature using the ideal gas equation and the three provided state variables.

Unit-aware inputs Deterministic calculation Engineering interpretation
Calculation workspace

Enter the known values and review the calculated result

Deterministic calculation
01
Parameters

Input parameters

Use consistent values and select the intended engineering units.

Ideal Gas State Variables

Additional Parameters

02
Output

Results

Live
Ready to calculate Complete the required inputs and run the calculation.
Engineering Pro Save, document and continue this calculation

Turn this result into a reusable engineering record with saving, PDF export and reporting workflows.

Engineering reference

Method, application and limitations

Review the calculation method, intended application and engineering assumptions before using the result in a design decision.

01
Method

Formula and calculation method

pressure, volume, amount of substance and temperature formula:

P · V = n · R · T

Rearranged forms:

  • P = (n · R · T) / V
  • V = (n · R · T) / P
  • n = (P · V) / (R · T)
  • T = (P · V) / (n · R)

where:

  • P — Pressure [Pa]
  • V — Volume [m³]
  • n — Amount of substance [mol]
  • T — Temperature [K]
  • R — Gas constant = 8.314462618 [J/(mol·K)]
02
Application

When to use this calculator

When to use this calculator:

  • Calculate missing gas pressure when volume, amount of substance and temperature are known.
  • Calculate required gas volume from pressure, amount of substance and temperature.
  • Calculate amount of substance from pressure, volume and temperature.
  • Calculate absolute temperature from pressure, volume and amount of substance.
  • Check the ideal gas equation residual after solving one missing state variable.
  • Calculate molar volume, molar density and density when molar mass is provided.
03
Decision support

How to interpret the result

The calculated state variable is defined as the missing value required to satisfy P · V = n · R · T.

The result depends on the three provided gas state variables. Increasing pressure increases calculated amount of substance when volume and temperature are fixed. Increasing volume increases calculated amount of substance when pressure and temperature are fixed. Increasing temperature decreases calculated amount of substance when pressure and volume are fixed.

  • Safe — the ideal gas equation residual is not greater than 1e-5.
  • Info — the ideal gas equation residual is greater than 1e-5 and not greater than 1e-3.
  • Warning — the ideal gas equation residual is greater than 1e-3.
  • Invalid — not exactly one state variable is empty, or at least one required positive input is missing, non-finite or not greater than zero.

The result is used to complete the gas state from pressure, volume, amount of substance and temperature.

04
Worked case

Calculation example

Example:

A user wants to calculate the missing amount of substance for a gas state with known pressure, volume and temperature.

  • P — Pressure = 101325 Pa
  • V — Volume = 1 m³
  • T — Temperature = 293.15 K
  • n — Amount of substance = empty

n = (101325 · 1) / (8.314462618 · 293.15) = 41.57 mol

05
Model boundaries

Assumptions and limitations

  • The gas state is solved using P · V = n · R · T.
  • Exactly one of pressure, volume, amount of substance or temperature must be empty.
  • All provided pressure, volume, amount of substance and temperature values must be greater than zero.
  • Molar mass is optional, but when provided it must be greater than zero.
  • Density is calculated only when molar mass is provided.
06
Questions

Frequently asked questions

How to calculate pressure, volume, amount of substance or temperature?
One state variable is calculated from P · V = n · R · T. Pressure is calculated from amount of substance, temperature and volume. Volume is calculated from amount of substance, temperature and pressure. Amount of substance is calculated from pressure, volume and temperature. Temperature is calculated from pressure, volume and amount of substance.
What affects the calculated ideal gas state variable the most?
The result depends on the three provided state variables. Increasing amount of substance or temperature increases calculated pressure when volume is fixed. Increasing pressure increases calculated amount of substance when volume and temperature are fixed. Increasing volume decreases calculated pressure when amount of substance and temperature are fixed.
When is the ideal gas formula not valid?
The calculation is invalid when not exactly one of pressure, volume, amount of substance or temperature is empty. It is also invalid when any provided pressure, volume, amount of substance, temperature or molar mass is not greater than zero.
Can this calculator be used when molar mass is provided?
It can be used with molar mass when molar mass is greater than zero. In that case, the calculator also returns density from amount of substance, molar mass and volume.
Add an engineering note