Ideal Gas Law Calculator
Solve the equation of state p·V = m·R_s·T or p·V = n·R_m·T for any quantity. Pick the unknown, enter the three known values and choose the gas – the calculator returns the fourth quantity together with the density, live with every input.
Ideal Gas Calculator
Model: ideal gas (no intermolecular forces, no particle volume). Temperature always absolute in kelvin. A good approximation for air and other gases at moderate pressure and temperatures well above liquefaction; near the condensation or critical point real equations of state should be used.
Result
Calculating …
Formulas and fundamentals
The ideal gas law relates pressure p, volume V, amount of gas and absolute temperature T. In mass form it reads p·V = m·R_s·T with mass m and the specific gas constant R_s; in molar form p·V = n·R_m·T with amount of substance n and the universal gas constant R_m = 8.314 J/(mol·K). Both forms are linked through R_s = R_m/M with the molar mass M; for air this gives R_s = 287 J/(kg·K). Since the equation is a single relation between four quantities, any three known values determine the fourth uniquely.
Consistent SI base units and absolute temperature in kelvin are essential: pressure in pascal, volume in cubic metres, mass in kilograms, temperature in kelvin. A common mistake is using degrees Celsius – the temperature must always enter as the absolute value T = ϑ + 273.15 K, otherwise the result is grossly wrong. From the solved state the density follows directly as ρ = m/V = p/(R_s·T), rising with pressure and falling with temperature.
The ideal gas law is a limiting law: it describes a hypothetical gas whose particles have no own volume and exert no forces on each other. Real gases obey it the better the lower the pressure and the higher the temperature above liquefaction. Near the condensation or critical point noticeable deviations occur; then real equations of state such as the Van der Waals equation or a real-gas factor Z are needed.
Worked example
Find the mass of air in a vessel of V = 1 m³ at p = 1·10⁵ Pa (1 bar) and T = 300 K. With the specific gas constant of air R_s = 287 J/(kg·K), p·V = m·R_s·T gives the mass m = p·V/(R_s·T).
Substituting: m = (1·10⁵ · 1) / (287 · 300) = 100000 / 86100 = 1.16144 kg. The density of the air in this state is ρ = m/V = 1.16144 kg/m³ – the familiar reference value for air at ambient conditions.
Raising the temperature at fixed volume and mass increases the pressure proportionally to T, since p = m·R_s·T/V. Halving the volume at constant temperature doubles the pressure – the Boyle-Mariotte limiting case contained in the ideal gas law as a special case.
Frequently asked questions
What is the difference between R_s and R_m?
R_m is the universal gas constant 8.314 J/(mol·K) and applies to any ideal gas in the molar form p·V = n·R_m·T. R_s is the specific gas constant of a particular gas in J/(kg·K) for the mass form p·V = m·R_s·T. Both are linked by R_s = R_m/M with the molar mass M; for air this gives 287 J/(kg·K).
Why must the temperature be entered in kelvin?
Because the gas law expresses proportionality to the absolute temperature. Only the kelvin scale has its zero at absolute zero; degrees Celsius has an arbitrary zero and would give wrong or even negative values. Conversion: T = ϑ in °C + 273.15.
How accurate is the ideal gas law for real gases?
For air and other gases at moderate pressure and temperatures well above liquefaction it is very accurate (deviation usually below 1 percent). At high pressure or near the condensation point real gases deviate; then a real-gas factor Z is used (p·V = Z·m·R_s·T) or a real equation of state.
Can I read the density off the result?
Yes. In the mass form the density is ρ = m/V = p/(R_s·T). The calculator outputs it directly, so you can check how air density changes with altitude (pressure) and temperature.
Which quantity should I choose as the unknown?
The one quantity you do not know. The other three are the input. The calculator solves the equation for the chosen quantity, so you can equally find pressure, volume, mass or amount of substance, or temperature.
Related tools
Gas State Changes
Calculate state changes of ideal gases online: isothermal, isobaric, isochoric, adiabatic and polytropic. From an initial state and one target value get the final state, boundary work, heat, internal energy and entropy with a p-V diagram and PDF.
Otto & Diesel Cycle
Calculate the thermal efficiency of the ideal Otto and Diesel cycles online: enter compression ratio and isentropic exponent to get corner states, heat, mean effective pressure and the p-V diagram, live.
Material properties
Look up strength and material properties of common engineering materials.