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.
Calculator is for informational purposes only. Terms and Conditions
The calculation uses absolute pressure and absolute temperature. Optional \(Z\) correction uses \(PV=ZnRT\) when you already know an appropriate compressibility factor.
Choose the calculation setup
Choose the unknown, pressure reference, unit mix, and whether to apply a known compressibility factor.
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.
Result
The requested state variable appears first, followed by conversions, equation checks, and optional derived gas properties.
Result details
- Equation check—
Show calculation steps Review conversions, rearrangement, substitution, assumptions, and reverse checks
- Enter valid values to see the complete calculation.
Method, Sources, and Assumptions
Calculation basis, constants, pressure/temperature conventions, limitations, and authoritative references.
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.
-
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.
-
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.
-
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.
-
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}}\).
-
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
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
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
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.
Convert the pressure
Substitute the values
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.
| 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
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.
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
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
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
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.
| 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.
| 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.
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.
- NIST CODATA Value: Molar Gas Constant — supports \(R=8.314462618\ldots\ \mathrm{J/(mol\cdot K)}\) from the 2022 CODATA recommended values.
- NIST CODATA Molar Volume of Ideal Gas — supports the \(273.15\ \mathrm{K}\), \(101.325\ \mathrm{kPa}\) reference value of \(22.41396954\ldots\times10^{-3}\ \mathrm{m^3/mol}\).
- IUPAC Gold Book: Standard Conditions for Gases— supports the current STP definition of 273.15 K and 100 kPa for gases.
- OpenStax Chemistry 2e: The Ideal Gas Law — supports the \(PV=nRT\) relationship, Kelvin requirement for gas-law calculations, and ideal-gas behavior context.
- OpenStax College Physics 2e: The Ideal Gas Law — supports the use of absolute pressure and absolute temperature in ideal-gas calculations.
- OpenStax Chemistry 2e: Non-Ideal Gas Behavior — supports the compressibility-factor definition and the physical reasons real gases depart from ideal behavior.
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.