Ideal Gas Law Calculator — Solve PV = nRT for Pressure, Volume, Amount of Substance or Temperature
Solve one missing ideal-gas state variable from the other three, then calculate molar volume and molar density; add molar mass to obtain gas mass and density.
Enter the known values and review the calculated result
Input parameters
Use consistent values and select the intended engineering units.
Ideal Gas State Variables
Optional Gas Property
Results
Calculation tools Save, export and manage your results
Save your calculation, export available results, or store a finalized engineering artifact in your account.
Method, application and limitations
Review the calculation method, intended application and engineering assumptions before using the result in a design decision.
Formula and calculation method
Ideal Gas Law — PV = nRT
The calculator solves the ideal gas equation for exactly one missing state variable:
P · V = n · R · T
where:
- P — absolute pressure [Pa]
- V — gas volume [m³]
- n — amount of substance [mol]
- T — absolute temperature [K]
- R — universal molar gas constant = 8.31446261815324 J/(mol·K)
Rearranged ideal gas equations
When pressure is unknown:
P = nRT / V
When volume is unknown:
V = nRT / P
When amount of substance is unknown:
n = PV / (RT)
When temperature is unknown:
T = PV / (nR)
Secondary gas properties
After the complete P–V–n–T state has been determined, the calculator also evaluates molar volume:
Vm = V / n
where Vm is the molar volume [m³/mol].
Molar density is calculated as:
ρmol = n / V
where ρmol is the molar density [mol/m³].
Mass and gas density from molar mass
If the optional molar mass M is provided, gas mass is calculated from:
m = nM
and gas density is then:
ρ = m / V
where:
- M — molar mass [kg/mol in the calculation basis]
- m — gas mass [kg]
- ρ — gas density [kg/m³]
Exactly one of P, V, n or T must be left unknown. All supplied state variables must be finite and greater than zero. Molar mass is optional, but must also be greater than zero when provided.
When to use this calculator
When to use this calculator
Use this ideal gas law calculator when three of the four state variables in PV = nRT are known and you need to determine the fourth.
It can be used to:
- calculate absolute gas pressure from volume, amount of substance and temperature,
- calculate 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,
- calculate molar volume for the completed ideal-gas state,
- calculate molar density from amount of substance and volume,
- calculate gas mass when molar mass is supplied,
- calculate ideal-gas density when molar mass is supplied.
The calculator is useful for thermodynamic state calculations, preliminary gas-system calculations, laboratory calculations and engineering estimates where the ideal-gas model is appropriate.
When this calculator is not the correct tool
This calculator represents a single ideal-gas state. It is not a combined gas law calculator for comparing two separate states, and it does not calculate a gas-specific molar mass from chemical composition.
It also does not apply a compressibility factor, determine real-gas properties, solve a real-gas equation of state, evaluate phase equilibrium, condensation, pressure drop, heat transfer or transient gas-system behavior.
If non-ideal gas behavior is significant for the application, a real-gas property calculation or another appropriate equation-of-state method should be used instead of relying on the ideal-gas result alone.
How to interpret the result
How to interpret the results
The primary result is the one missing state variable required to complete the entered ideal-gas state according to PV = nRT.
Calculated pressure P
If pressure is the missing variable, the result is the absolute pressure required for the entered volume, amount of substance and temperature. With the other variables fixed, calculated pressure increases with increasing n or T and decreases with increasing V.
Calculated volume V
If volume is the missing variable, the result is the volume required for the entered pressure, amount of substance and temperature. With the other variables fixed, calculated volume increases with increasing n or T and decreases with increasing P.
Calculated amount of substance n
If n is the missing variable, the result is the amount of substance required for the entered pressure, volume and temperature. With the other variables fixed, calculated n increases with pressure or volume and decreases with increasing temperature.
Calculated temperature T
If temperature is the missing variable, the result is the absolute temperature required for the entered pressure, volume and amount of substance. With the other variables fixed, calculated temperature increases with pressure or volume and decreases with increasing n.
Molar volume Vm
Molar volume is the total gas volume divided by the amount of substance. A larger Vm means that each mole occupies more volume in the calculated ideal-gas state.
Molar density ρmol
Molar density is the amount of substance per unit volume. It is the reciprocal relationship to molar volume for the same state: a higher molar density corresponds to a lower molar volume.
Gas mass m
Gas mass is returned only when molar mass is supplied. It is calculated as the amount of substance multiplied by the entered molar mass.
Gas density ρ
Mass density is also returned only when molar mass is supplied. It represents the calculated gas mass per unit volume for the completed ideal-gas state.
Invalid result
The calculation is invalid if exactly one of P, V, n or T is not left unknown, if a required state variable is non-finite or not greater than zero, or if an entered molar mass is not finite and greater than zero.
A successfully calculated state only confirms consistency with the ideal gas equation implemented by this calculator. It does not confirm that the actual gas behaves ideally under the evaluated operating conditions.
Calculation example
Example — Calculate amount of substance and gas density
A gas occupies a volume of 1.000 m³ at an absolute pressure of 101325 Pa and an absolute temperature of 293.15 K. Determine the amount of substance using the ideal gas law. Assume an optional molar mass of 0.02897 kg/mol to also calculate gas mass and density.
Input data
- P = 101325 Pa
- V = 1.000 m³
- T = 293.15 K
- n = unknown
- M = 0.02897 kg/mol
- R = 8.31446261815324 J/(mol·K)
Step 1 — Solve PV = nRT for n
n = PV / (RT)
n = (101325 × 1.000) / (8.31446261815324 × 293.15)
n = 41.5712 mol
Step 2 — Calculate molar volume
Vm = V / n
Vm = 1.000 / 41.5712 = 0.0240551 m³/mol
Step 3 — Calculate molar density
ρmol = n / V
ρmol = 41.5712 / 1.000 = 41.5712 mol/m³
Step 4 — Calculate gas mass
m = nM
m = 41.5712 × 0.02897 = 1.20432 kg
Step 5 — Calculate gas density
ρ = m / V
ρ = 1.20432 / 1.000 = 1.20432 kg/m³
Result
- Amount of substance: 41.5712 mol
- Molar volume: 0.0240551 m³/mol
- Molar density: 41.5712 mol/m³
- Gas mass: 1.20432 kg
- Gas density: 1.20432 kg/m³
The calculation gives the state required by the ideal gas equation for the supplied pressure, volume and temperature. The mass-based results depend directly on the entered molar mass. They remain ideal-gas estimates and do not include a real-gas compressibility correction.
Assumptions and limitations
Assumptions and limitations
- The calculation uses the ideal gas equation P · V = n · R · T.
- Exactly one of P, V, n or T must be unknown. The calculator does not solve an underdetermined state with two or more missing variables.
- Pressure represents absolute pressure and must be finite and greater than zero when provided.
- Volume must be finite and greater than zero when provided.
- Amount of substance must be finite and greater than zero when provided.
- Temperature represents absolute thermodynamic temperature and must be finite and greater than zero on the calculation basis.
- The universal molar gas constant used by the calculation is R = 8.31446261815324 J/(mol·K).
- Molar mass is optional. When entered, it must be finite and greater than zero.
- The calculator does not determine molar mass, molecular weight or gas composition.
- Mass and mass density are calculated only when molar mass is supplied.
- The calculated density is based on the ideal-gas state and the entered molar mass.
- The method does not include a compressibility factor Z or any other correction for non-ideal gas behavior.
- The calculator does not implement a real-gas equation of state or determine real-gas properties from critical properties or composition.
- The model represents one gas state and does not calculate a transition between separate initial and final states.
- Phase change, condensation, evaporation, two-phase equilibrium and saturation limits are outside the implemented calculation.
- Pressure drop, heat transfer, chemical reactions and transient storage behavior are not calculated.
- No uncertainty or measurement-error propagation is included. Uncertainty in the entered state variables or molar mass is not quantified by the result.
- The suitability of the ideal-gas approximation for the actual gas and operating conditions must be assessed separately when the result is used for engineering decisions.
