Skip to main content
Calcimator

Ideal Gas Law Calculator

Solve PV = nRT for any unknown variable — pressure, volume, moles, or temperature. Includes isothermal P-V curve visualization.

About this calculator

The ideal gas law, PV = nRT, links a gas's pressure, volume, amount, and absolute temperature through a single constant of proportionality, R. This calculator uses R = 0.08206 L·atm/(mol·K), which is why pressure defaults to atmospheres and volume to liters — plug in values in those units and the algebra falls out directly by rearranging the equation for whichever variable you select to solve for, with the other three treated as known inputs. Alongside the solved variable, the calculator reports the same pressure in kilopascals and the same temperature in Celsius purely as unit conversions for convenience, not as independent calculations.

It also reports a "molar density" (moles per liter, n/V) rather than a true mass density in grams per liter — going from moles to mass would require the gas's molar weight, which isn't collected as an input, so don't confuse this figure with the density you'd measure on a gas of known identity. The isothermal curve chart plots pressure against volume from 1 to 50 liters while holding moles and temperature fixed at whatever values you entered (or computed), tracing the classic inverse P-V relationship at constant T. The biggest limitation to keep in mind: the ideal gas law assumes point-mass molecules with no intermolecular attraction, which breaks down at high pressure or low temperature where real gases condense or deviate significantly — this calculator won't warn you when you've entered conditions far outside where the ideal approximation actually holds.

Inputs

L
mol
K

Results

Result

1.00066

Solved VariablePressure (P)
Pressure1.00066 atm
Pressure101.39 kPa
Volume22.4 L
Moles1 mol
Temperature273.15 K
Temperature0 °C
Molar Density0.04464 mol/L

The ideal gas law

  1. 1.Multiply moles, the gas constant and temperature
    nRT=1×0.0821×273.15=22.41

    This product is the total thermal energy available to the gas. R is the bridge between a count of molecules and an energy — it exists precisely so this multiplication has consistent units.

  2. 2.Divide by the volume
    P=22.4122.4=1

    Pressure is that energy spread over the space the gas occupies. Squeeze the same energy into less volume and the pressure rises in exact proportion.

Where the units go

  • mol × L·atm/(mol·K) × K ÷ L mol · K · L→atm
Émile Clapeyron combined Boyle's, Charles' and Avogadro's separate observations into one equation of state, introducing the constant that carries the relationship between the amount of gas and its energy.
Émile Clapeyron, 'Mémoire sur la puissance motrice de la chaleur', Journal de l'École Polytechnique, vol. 14·1834
How to Use This Calculator
  1. Select which variable to solve for (pressure, volume, moles, or temperature).
  2. Enter the known values for the other three variables with appropriate units.
  3. Review the calculated result using the ideal gas law: PV = nRT.
  4. Use this for standard conditions — real gases deviate at high pressure or low temperature.

How the result changes with Volume (V)

Volume (V)Result
112.0377
171.31851
340.65926
560.40026

What each input means

Solve For
Select which variable to solve for — the other three are inputs
Pressure (P)
Gas pressure in atmospheres (1 atm = 101.325 kPa)
Volume (V)
Gas volume in liters (22.4 L = 1 mol ideal gas at STP)
Moles (n)
Amount of gas in moles
Temperature (T)
Absolute temperature in Kelvin (0°C = 273.15 K)

How this is calculated

Formula

PV = nRT

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Solve For = 1, Pressure (P) = 1, Volume (V) = 22.4, Moles (n) = 1 = 5 input(s) provided
  2. Calculate Result
    Result
    1.00066 = 1.00066
  3. Calculate Solved Variable
    Solved Variable
    Pressure (P) = Pressure (P)
  4. Calculate Pressure
    Pressure = P
    1.00066 = 1.00066

Engine last updated . Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Why does the field I'm solving for still show a value?

Whichever variable you select in Solve For gets recalculated by rearranging PV = nRT and overwrites the default or entered value for that field — for example, selecting Volume computes V = (n × R × T) / P, replacing whatever default volume was there. The displayed value for that output always reflects the calculated result, not an input you typed.

What is Molar Density actually measuring, and why isn't it a real density?

Molar density is simply moles divided by volume (n/V), computed directly from the same inputs used to solve the gas law. It is not mass density in grams per liter, because that would require the gas's molar weight, which this calculator never collects as an input — don't treat it as equivalent to the density you'd measure for a specific real gas.

Why does the P-V curve look the same shape no matter which variable I solve for?

The isotherm chart always plots pressure as (n × R × T) / volume across volumes from 1 to 50 liters, using whichever moles and temperature end up in the final result (whether entered or solved-for). It holds those two fixed and only varies volume, so the curve is always the same inverse relationship, just scaled by your specific n and T.

Why does the calculator use R = 0.08206 instead of the SI value of 8.314?

0.08206 L·atm/(mol·K) is the version of the gas constant matched to this calculator's chosen units — atmospheres for pressure, liters for volume — so the algebra works without any unit conversion. The kPa output is a display convenience computed from the atm result afterward, not a change to the underlying calculation.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Science & Physics.