Ideal Gas Law Calculator (PV = nRT)

Solve PV = nRT for pressure, volume, moles, temperature or mass.

Workspace

Ideal Gas Law Calculator (PV = nRT): what this tool is for

The online Ideal Gas Law calculator instantly solves the fundamental equation of state PV = nRT by calculating pressure (P), volume (V), amount of substance (n), absolute temperature (T), or gas mass (m).

Derived from the combined historical empirical laws of Boyle, Charles, Gay-Lussac, and Avogadro, the ideal gas equation unites thermodynamic state variables using the universal gas constant R = 8.314462618 J·mol⁻¹·K⁻¹.

The tool includes a multi-unit converter supporting all common pressure, volume, and temperature scales (atm, bar, Pa, kPa, hPa, psi, mmHg, Torr, L, mL, m³, °C, K, °F), while computing gas density (ρ) and molar volume (Vm) under specific experimental conditions.

With the built-in chemical formula parser, simply type your gas formula (He, N₂, O₂, CO₂, CH₄, etc.) to automatically retrieve IUPAC molar mass and compute total mass or density effortlessly.

All thermodynamic calculations execute strictly in your web browser: no experimental formulation data is transmitted over the network, ensuring instantaneous results and absolute privacy.

  • No file stored

    Selected files are processed in your browser, without being uploaded to Xorvian.

  • Local processing

    Calculations run locally. The currency converter requests rates from an external service.

  • Processing time

    The time needed depends on the tool, the file and your device's capabilities.

  • Free, no account

    Tools are available without registration. An account lets you synchronize favorites and history.

What this tool gives you

  • Full Multidirectional Solving

    Solve for pressure, volume, moles, temperature, or mass seamlessly by switching the target variable with a single click.

  • Universal Unit Compatibility

    Work freely in atmospheres, bars, pascals, torr/mmHg, liters, cubic meters, degrees Celsius, Fahrenheit, or Kelvin.

  • Automatic Molar Mass & Density

    Parses chemical formulas to extract exact molar mass and determine gas density in g/L and kg/m³.

  • Built-in STP & SATP Standards

    Directly benchmark your values against Standard Temperature and Pressure (STP 0 °C, 1 atm) and Standard Ambient conditions (SATP 25 °C, 1 bar).

Real-world examples

Standard physical constants and benchmark conditions used in solving the ideal gas equation of state.

Universal Gas Constant (R) across common unit systems
Pressure UnitVolume UnitTemperature UnitValue of R ConstantTypical Field of Application
Pascal (Pa = N/m²)Cubic meter (m³)Kelvin (K)8.31446 J·mol⁻¹·K⁻¹International System (SI), Physics
Atmosphere (atm)Liter (L)Kelvin (K)0.082057 L·atm·mol⁻¹·K⁻¹General Chemistry, Education
Bar (bar = 10⁵ Pa)Liter (L)Kelvin (K)0.083145 L·bar·mol⁻¹·K⁻¹Chemical Engineering, Industry
Millimeter of mercury (mmHg)Liter (L)Kelvin (K)62.3637 L·mmHg·mol⁻¹·K⁻¹Manometry, Respiratory Physiology
Theoretical molar volume and density at standard conditions
Gas SpeciesMolar Mass (g/mol)Conditions (T, P)Molar Volume (Vm)Gas Density (ρ)
Helium (He)4.003 g/molSTP: 0 °C, 1 atm22.414 L/mol0.1786 g/L
Nitrogen (N₂)28.013 g/molSTP: 0 °C, 1 atm22.414 L/mol1.2498 g/L
Oxygen (O₂)31.999 g/molSATP: 25 °C, 1 bar24.789 L/mol1.2908 g/L
Carbon Dioxide (CO₂)44.010 g/molSATP: 25 °C, 1 bar24.789 L/mol1.7754 g/L
Methane (CH₄)16.043 g/mol20 °C, 1 atm24.055 L/mol0.6669 g/L

Calculating the volume of 1 mole of gas at 0 °C and 1 atm (STP)

Given n = 1 mol, T = 0 °C = 273.15 K, and P = 1 atm = 101,325 Pa: V = (n × R × T) / P = (1 × 8.31446 × 273.15) / 101,325 = 0.022414 m³ = 22.414 L. This is the classical standard molar volume.

Calculating the mass of CO₂ inside a 10 L cylinder at 25 °C and 5 bar

With P = 5 × 10⁵ Pa, V = 0.010 m³, T = 298.15 K, and M(CO₂) = 44.01 g/mol: n = (500,000 × 0.010) / (8.31446 × 298.15) = 2.017 mol. The contained mass is m = n × M = 2.017 × 44.01 = 88.77 g.

How to use Ideal Gas Law Calculator (PV = nRT)

  1. Select your target variable

    Choose the physical property to determine: Pressure (P), Volume (V), Amount of substance (n), Temperature (T), or Mass (m).

  2. Specify the gas formula or molar mass

    Enter the chemical formula (e.g., CO2, He, N2) to automatically populate molar mass and calculate density.

  3. Enter known parameters and unit preferences

    Input known values using your preferred units for pressure (bar, atm, Pa, psi, mmHg), volume (L, mL, m³), and temperature (°C, K, °F).

  4. Examine thermodynamic results and copy summary

    Review calculated values, molar volume (Vm), and gas density (ρ), then copy the full summary directly to your clipboard.

Tips and mistakes to avoid

Always use absolute temperature in Kelvin

Thermodynamic equations require temperature in Kelvin: T(K) = T(°C) + 273.15. Calculations using Celsius produce meaningless results near 0 °C.

Consistent units in manual calculations

When using R = 0.082057 L·atm·mol⁻¹·K⁻¹, pressure must be in atmospheres and volume in liters. In SI units (Pa and m³), use R = 8.31446 J·mol⁻¹·K⁻¹.

STP vs SATP definitions

STP refers to 0 °C (273.15 K) and 1 atm (101.325 kPa) with Vm ≈ 22.414 L/mol. SATP corresponds to 25 °C (298.15 K) and 1 bar (100 kPa) with Vm ≈ 24.789 L/mol.

Avoid : Omitting Celsius-to-Kelvin conversion

Plugging 0 °C directly into PV = nRT yields an erroneous volume of 0 L. The true physical lower bound is absolute zero (0 K = -273.15 °C).

Avoid : Applying ideal gas equations at high pressures

Above 5–10 bar or near liquefaction temperatures, molecular covolume and intermolecular attractions require real gas models like the Van der Waals equation.

Frequently asked questions

Answers to the questions people ask about Ideal Gas Law Calculator (PV = nRT).

The Ideal Gas Law is the equation of state modeling a hypothetical gas of non-interacting point particles. It connects pressure P, volume V, molar amount n, the universal gas constant R, and absolute temperature T.

In SI units (Pa·m³/(mol·K)), R = 8.314462618 J·mol⁻¹·K⁻¹. In standard laboratory chemistry, R = 0.082057 L·atm·mol⁻¹·K⁻¹ or R = 0.083145 L·bar·mol⁻¹·K⁻¹ are common.

From mass m and molar mass M, calculate molar amount n = m / M, then solve V = (n · R · T) / P. The calculator completes this automatically when you enter the gas formula.

Molar volume Vm is the volume occupied by one mole of gas under specific temperature and pressure: Vm = V / n = (R · T) / P. At STP (0 °C, 1 atm), Vm is 22.414 L/mol; at SATP (25 °C, 1 bar), Vm is 24.789 L/mol.

Gas density is derived by combining mass and volume: ρ = m / V = (P · M) / (R · T). It is expressed in g/L, which is numerically identical to kg/m³.

Kelvin is an absolute thermodynamic temperature scale with zero representing complete kinetic cessation. Average molecular kinetic energy is directly proportional to temperature in Kelvin.

The model is accurate for low-to-moderate pressures (< 5 bar) and temperatures far above liquefaction. For real gases under high pressure or low temperature, Van der Waals corrections are necessary.

Yes. All unit conversions and thermodynamic formulas are computed locally in your web browser with zero server data exchange.

Related tools

Tools people open right after this one.

Updated on August 2026. See all tools