Ideal Gas Law Calculator

Solve \(PV=nRT\) for pressure, volume, moles, or temperature using mixed units, with optional gauge-pressure and real-gas \(Z\) correction.

Example values loaded The default example is 1 mol at IUPAC standard conditions: 273.15 K and 100 kPa.

Calculator is for informational purposes only. Terms and Conditions

\[ PV=nRT \]

The calculation uses absolute pressure and absolute temperature. Optional \(Z\) correction uses \(PV=ZnRT\) when you already know an appropriate compressibility factor.

1

Choose the calculation setup

Choose the unknown, pressure reference, unit mix, and whether to apply a known compressibility factor.

Calculation setup

The selected unknown is removed from the required known values and calculated from the other three.

\(PV=nRT\) requires absolute pressure. Gauge inputs are converted by adding atmospheric pressure.

Changing the preset converts existing values instead of reinterpreting them.

Use the ideal model unless you have a validated compressibility factor for the gas state.

Enter pressure, amount of gas, and temperature to solve for volume.
2

Enter the known values

You can mix supported units. All calculations are performed from canonical SI base values.

Fields marked required must be completed. Pressure and temperature are converted to absolute values before the gas-law equation is evaluated.

Enter the gas pressure using the pressure reference selected above.

Enter the amount of substance in moles, kmol, or lbmol.

Celsius and Fahrenheit inputs are converted to absolute temperature internally.

Advanced Options

Add molar mass to calculate gas mass and density as secondary results.

Valid results also update as you edit.

3

Result

The requested state variable appears first, followed by conversions, equation checks, and optional derived gas properties.

Volume (V)
Enter the required values to calculate.

Result details

  • Equation check
Show calculation steps Review conversions, rearrangement, substitution, assumptions, and reverse checks
  1. Enter valid values to see the complete calculation.
4

Method, Sources, and Assumptions

Calculation basis, constants, pressure/temperature conventions, limitations, and authoritative references.

Exact ideal-gas relationship
R = 8.31446261815324 J/(mol·K) Absolute temperature Absolute pressure in equation

The solver evaluates \(PV=nRT\) in SI base units. When a known compressibility factor is enabled it evaluates \(PV=ZnRT\). IUPAC standard gas conditions are 273.15 K and 100 kPa.

  • The ideal-gas model is exact only for an ideal gas; real gases can deviate materially at high density, low temperature, or near phase boundaries and critical conditions.
  • Gauge pressure is converted to absolute pressure by adding the user-specified atmospheric pressure.
  • The optional Z mode uses a user-supplied compressibility factor and does not estimate Z from an equation of state.
  • Use appropriate real-gas property software, standards, manufacturer data, and professional judgment when deviations can affect safety or design decisions.

Calculator guide

How This Ideal Gas Law Calculator Works

The calculator above solves the ideal gas relationship for pressure, volume, amount of gas, or temperature. Choose the unknown, enter the other three state variables, select the units you have, and the calculator converts them to a consistent internal unit system before solving. When Pressure is the unknown, the primary answer is absolute pressure.

The governing relationship is \(PV=nRT\) for an ideal gas. Pressure must be on an absolute basis and temperature must be on an absolute temperature scale. The calculator can also apply a user-supplied compressibility factor \(Z\) through \(PV=ZnRT\), and an optional molar-mass input adds gas mass, density, and molar-volume context to the solved state.

Solves for
Pressure \(P\), volume \(V\), moles \(n\), or temperature \(T\)
Core relationship
\(PV=nRT\), or \(PV=ZnRT\) with a known compressibility factor
Critical input rule
Use absolute pressure and absolute temperature in the gas-law equation

How to Use the Calculator Correctly

The fastest reliable workflow is to identify the one unknown state variable, enter the other three known values, then verify that pressure and temperature are referenced correctly before trusting the answer.

  1. Choose the quantity to solve for

    Select Pressure, Volume, Moles, or Temperature. The selected unknown is removed from the required inputs and becomes the primary result. If Pressure is selected, the calculator reports absolute pressure because that is the pressure basis required by the gas-law equation.

  2. Enter the three known gas-state values

    Use the pressure, volume, amount, and temperature values that describe the same gas state. Do not mix measurements taken from different operating states unless that is intentionally part of a separate two-state gas-law analysis.

  3. Select the units you actually have

    The calculator supports mixed engineering and laboratory units and converts them internally. Changing a unit selector converts the represented physical quantity rather than merely changing the unit label.

  4. Set the pressure reference correctly

    Choose absolute pressure when the entered pressure is already absolute. Choose gauge pressure when the measurement is relative to ambient pressure; the calculator then uses the atmospheric-pressure value to determine \(P_{\mathrm{abs}}\).

  5. Use \(Z\) only when you have a defensible value

    Ideal-gas mode uses \(Z=1\). If you select the known-\(Z\) method, enter a compressibility factor appropriate to the actual gas, temperature, and pressure rather than guessing one.

Ideal Gas Law Formula and Rearrangements

The ideal gas law is a closed-form relationship between absolute pressure, volume, amount of gas, and absolute temperature. The calculator rearranges the same equation for whichever variable you select as the unknown.

Ideal gas equation

\[ PV=nRT \]

In plain language: pressure multiplied by volume equals the number of moles multiplied by the universal gas constant and absolute temperature.

The calculator uses the molar gas constant \(R=8.314462618\ldots\ \mathrm{J/(mol\cdot K)}\), consistent with the current CODATA value published by NIST. You do not need to choose a numerical value of \(R\) manually; the calculator converts supported input units to a consistent internal basis before solving.

Four useful solve forms

\[ P=\frac{nRT}{V},\qquad V=\frac{nRT}{P},\qquad n=\frac{PV}{RT},\qquad T=\frac{PV}{nR} \]

Each expression isolates one unknown while the other three state variables remain known. Pressure means the absolute pressure required by the specified \(V,n,T\) state; Volume is the space occupied or required at the specified \(P,n,T\); Moles is the amount of gas present; and Temperature is the absolute temperature required by the specified pressure-volume state.

Known compressibility-factor correction

\[ PV=ZnRT \]

A known compressibility factor scales the ideal relationship. \(Z=1\) reproduces the ideal-gas equation; values different from one represent departure from ideal behavior for the specific state represented by that \(Z\).

\(P\)
Absolute gas pressure. The calculator accepts units including Pa, kPa, MPa, bar, atm, psi, and Torr.
\(V\)
Gas volume. Supported units include cubic meters, liters, milliliters, cubic feet, cubic inches, and U.S. gallons.
\(n\)
Amount of gas in moles. The calculator also supports kmol and lbmol display units.
\(T\)
Absolute gas temperature. Kelvin and Rankine are absolute scales; Celsius and Fahrenheit inputs are converted before calculation.
\(R\)
Universal molar gas constant, \(8.314462618\ldots\ \mathrm{J/(mol\cdot K)}\).
\(Z\)
Dimensionless compressibility factor used only when the known-\(Z\) correction is selected.

Worked Example: Find Gas Volume

Consider one mole of ideal gas at \(273.15\ \mathrm{K}\) and \(100\ \mathrm{kPa}\). This is a useful verification case because the result can be checked directly by reversing the calculation.

Given values

Absolute pressure
\(P=100\ \mathrm{kPa}\)
Amount
\(n=1.000\ \mathrm{mol}\)
Temperature
\(T=273.15\ \mathrm{K}\)
Gas constant
\(R=8.314462618\ \mathrm{J/(mol\cdot K)}\)
Find
Gas volume \(V\)

Convert the pressure

\[ 100\ \mathrm{kPa}=100{,}000\ \mathrm{Pa} \]

Substitute the values

\[ V=\frac{nRT}{P} =\frac{(1.000)(8.314462618)(273.15)}{100{,}000} =0.02271095\ \mathrm{m^3} \]

Result

\(V\approx22.711\ \mathrm{L}\)

At \(273.15\ \mathrm{K}\) and \(100\ \mathrm{kPa}\), one mole of an ideal gas occupies about \(22.711\ \mathrm{L}\). This is different from the familiar \(22.414\ \mathrm{L/mol}\) value because that older reference value uses \(101.325\ \mathrm{kPa}\), or one standard atmosphere.

Units, Absolute Temperature, and Pressure Reference

Most large ideal-gas-law errors come from reference-state mistakes rather than difficult algebra. The two checks that matter most are converting temperature to an absolute scale and using absolute rather than gauge pressure.

Ideal gas law quantities and units accepted by the calculator
Quantity Canonical calculation basis Common supported display units
Pressure \(P\) Pa, absolute Pa, kPa, MPa, bar, atm, psi, Torr
Volume \(V\) \(\mathrm{m^3}\) \(\mathrm{m^3}\), L, mL, \(\mathrm{ft^3}\), \(\mathrm{in^3}\), U.S. gal
Amount \(n\) mol mol, kmol, lbmol
Temperature \(T\) K K, °C, °F, °R

Convert Celsius or Fahrenheit before manual calculation

\[ T_{\mathrm{K}}=T_{{}^{\circ}\mathrm{C}}+273.15 \]

For example, \(25^\circ\mathrm{C}=298.15\ \mathrm{K}\). Entering 25 directly as though it were Kelvin would describe a completely different physical state.

\[ P_{\mathrm{abs}}=P_{\mathrm{gauge}}+P_{\mathrm{atm}} \]

At a local atmospheric pressure of \(14.696\ \mathrm{psi}\), a reading of \(30\ \mathrm{psig}\) corresponds to approximately \(44.696\ \mathrm{psia}\).

  • If you change a unit in the calculator, the physical quantity is converted rather than reinterpreted.
  • If gauge pressure is selected, confirm that the atmospheric-pressure value matches the reference you intend to use.
  • When doing the calculation by hand, make sure the numerical form of \(R\) is dimensionally consistent with the pressure, volume, amount, and absolute-temperature units.

Molar Mass, Gas Mass, Density, and Molar Volume

The primary solver still determines only \(P\), \(V\), \(n\), or \(T\). When you also enter molar mass, the calculator can translate the solved mole amount into gas mass and density, while molar volume provides a useful state check even without molar mass.

Moles and gas mass

\[ m=nM \]

Here, \(m\) is gas mass and \(M\) is molar mass. The optional molar-mass field does not replace the required mole input when moles are a known state variable; it adds mass-based results to the solved state.

Gas density

\[ \rho=\frac{m}{V}=\frac{PM}{ZRT} \]

The second form follows from the gas-law relation when molar mass is known. In ideal-gas mode, \(Z=1\); in known-\(Z\) mode, the entered compressibility factor is used.

Molar volume

\[ V_m=\frac{V}{n} \]

Molar volume is volume per mole at the calculated pressure and temperature. It is not one universal constant: for example, changing the reference pressure changes the ideal-gas molar volume even at the same temperature.

STP and the 22.4 L vs 22.7 L Difference

The frequently quoted molar volumes of about \(22.4\ \mathrm{L/mol}\) and \(22.7\ \mathrm{L/mol}\) are both valid ideal-gas results, but they use different reference pressures. Current IUPAC standard temperature and pressure (STP) uses \(273.15\ \mathrm{K}\) and \(100\ \mathrm{kPa}\); the legacy 1-atm reference uses \(101.325\ \mathrm{kPa}\) at the same temperature.

Ideal-gas molar volume at 273.15 K under current IUPAC STP and the legacy 1-atm reference
Reference condition Pressure Temperature Ideal molar volume
Current IUPAC STP \(100\ \mathrm{kPa}\) \(273.15\ \mathrm{K}\) \(\approx22.711\ \mathrm{L/mol}\)
Legacy 1-atm reference \(101.325\ \mathrm{kPa}\) \(273.15\ \mathrm{K}\) \(\approx22.414\ \mathrm{L/mol}\)

IUPAC defines STP for gases as \(273.15\ \mathrm{K}\) and \(100\ \mathrm{kPa}\). NIST’s CODATA listing gives an ideal-gas molar volume of \(22.41396954\ldots\times10^{-3}\ \mathrm{m^3/mol}\) at \(273.15\ \mathrm{K}\) and \(101.325\ \mathrm{kPa}\). The 100 kPa value is the direct ideal-gas result for current IUPAC STP, which is why it is about \(22.711\ \mathrm{L/mol}\) rather than about \(22.414\ \mathrm{L/mol}\).

How to Interpret and Check the Result

A numerically valid result is only useful when it represents the same physical gas state as the inputs. Check the direction of change, equation balance, and whether the ideal-gas assumption is appropriate for the required accuracy.

Use proportional behavior as a mental check

With \(n\) and \(T\) held constant, pressure varies inversely with volume. Doubling \(V\) should halve \(P\). With \(n\) and \(V\) held constant, pressure varies directly with absolute temperature.

Check \(PV\) against \(nRT\)

In ideal-gas mode the two sides should agree apart from numerical rounding. With a known \(Z\), compare \(PV\) with \(ZnRT\). A large mismatch points to inconsistent state values or an implementation/input problem.

Watch for impossible absolute states

Absolute temperature must be above \(0\ \mathrm{K}\), volume and amount must be positive for the calculator’s gas-state model, and converted absolute pressure must remain above zero.

Fast proportionality checks for ideal-gas results
Solve / relationship Held constant Input change Expected ideal response
Pressure vs. volume \(n,T\) \(V\) doubles \(P\) halves
Pressure vs. temperature \(n,V\) \(T\) rises 10% on an absolute scale \(P\) rises 10%
Volume vs. moles \(P,T\) \(n\) doubles \(V\) doubles
Moles vs. volume \(P,T\) \(V\) doubles \(n\) doubles

Common Ideal Gas Law Mistakes

The algebra is simple enough that most serious errors come from unit basis, pressure reference, temperature scale, or model assumptions.

Using psig instead of psia

Gauge pressure is referenced to ambient pressure, while \(PV=nRT\) requires absolute pressure. Convert with \(P_{\mathrm{abs}}=P_{\mathrm{gauge}}+P_{\mathrm{atm}}\).

Using Celsius directly

Temperature ratios in gas laws require an absolute scale. Convert Celsius to Kelvin, or Fahrenheit to Rankine/Kelvin, before manual substitution.

Confusing mass with moles

The \(n\) in \(PV=nRT\) is amount of substance, not mass. If mass \(m\) and molar mass \(M\) are known, first use \(n=m/M\).

Using an arbitrary compressibility factor

A \(Z\) value is state-specific. It should come from a defensible property source, chart, correlation, equation of state, or software calculation for the actual gas composition and operating state.

Mixing STP conventions

A reference pressure of \(100\ \mathrm{kPa}\) gives a different molar volume than \(1\ \mathrm{atm}=101.325\ \mathrm{kPa}\). State the actual pressure and temperature rather than relying only on the abbreviation STP.

Assuming a real gas is always ideal

Real gases deviate from the ideal model as finite molecular volume and intermolecular forces become significant. The required accuracy and proximity to phase-change or critical conditions determine whether a more detailed model is needed.

Ideal-Gas Assumptions and Real-Gas Limits

The ideal gas law is an exact relationship for the ideal-gas model, not a universal property equation for every real gas state. Real-gas accuracy depends on gas identity, pressure, temperature, composition, and the precision required.

Negligible molecular volume

The ideal model treats molecular size as negligible compared with the gas volume. This approximation becomes less representative as the gas becomes denser.

Negligible intermolecular forces

The ideal model neglects attractive and repulsive interactions except for idealized collisions. These interactions matter more in states where molecules are closer together or the gas approaches condensation.

Single equilibrium state

The calculation assumes one meaningful pressure and one meaningful temperature describe the gas state. Systems with strong gradients, rapid transients, significant flow losses, or phase change may require a control-volume, transient, heat-transfer, fluid-flow, or more complete property model.

Known \(Z\) is a correction, not a predictor

The calculator can use a supplied compressibility factor, but it does not determine \(Z\) from gas critical properties or an equation of state. The quality of a \(PV=ZnRT\) result therefore depends on the quality of the \(Z\) value supplied.

Related Thermodynamics Resources

Use these Turn2Engineering resources when the next question moves beyond this calculator: broader gas-law selection, a deeper equation explanation, a separate density calculation, or the wider thermodynamics topic.

Sources and Calculation Basis

The calculator uses the ideal-gas relationship and unit conversions in a canonical SI calculation state. The worked example was independently recomputed and reverse-checked, while mass, density, and molar-volume relationships were checked algebraically from the same gas state.

For real-gas work, a supplied compressibility factor should be obtained for the actual gas composition and thermodynamic state. This guide does not substitute a universal \(Z\) value or a single pressure threshold for a real-gas property calculation.

Scroll to Top