Ideal Gas Law Calculator
Calculate pressure, volume, temperature, or moles using PV=nRT.
Calculate any variable in the ideal gas law equation PV = nRT. Enter pressure, volume, temperature, and number of moles to solve for the unknown variable.
—
Send feedback
💡 Share your idea or report a problem
✓ Thanks! We'll take a look.
Learn more
How It Works
The formula, explained simply
The ideal gas law calculator solves the fundamental equation PV = nRT for any unknown variable when you provide the other three. This equation describes how pressure (P), volume (V), number of moles (n), and temperature (T) relate for an ideal gas, with R being the universal gas constant.
When you select which variable to solve for, the calculator rearranges the equation automatically. For pressure: P = nRT/V. For volume: V = nRT/P. For temperature: T = PV/(nR). For moles: n = PV/(RT). The gas constant R equals 0.08314 bar⋅L/(mol⋅K) when using the units this calculator expects.
The calculation assumes your gas behaves ideally - meaning gas molecules have no size and don't attract each other. This works well for most gases at room temperature and moderate pressures. Enter your three known values and the calculator immediately shows the fourth variable, plus context about whether your result represents realistic conditions.
When To Use This
Right tool, right situation
Use the ideal gas law calculator when working with gases at moderate temperatures (above -50°C) and low to moderate pressures (below 10 bar). It excels for air, nitrogen, oxygen, carbon dioxide, and noble gases under normal laboratory or industrial conditions. Chemical engineers use it for initial design calculations before applying more complex equations.
The calculator is particularly useful for converting between different conditions - like determining how much a gas expands when heated, or what pressure develops when a fixed volume is heated. Students use it to solve textbook problems, while technicians apply it for compressed air systems, gas storage calculations, and HVAC design.
Avoid using ideal gas calculations for steam (use steam tables instead), gases near their boiling point, high-pressure systems like scuba tanks at depth, or precision work requiring accuracy better than 5%. For these applications, you need equations of state that account for molecular size and intermolecular forces.
Common Mistakes
Why results sometimes look wrong
The most common mistake is using Celsius instead of Kelvin for temperature. The ideal gas law requires absolute temperature because volume approaches zero at absolute zero (-273.15°C), not at 0°C. Using Celsius temperatures gives completely wrong results, especially for calculations involving temperature ratios.
Another frequent error is assuming the ideal gas law works for all conditions. It fails badly for gases near their condensation point, at pressures above 10 bar, or for polar molecules like water vapour. Steam tables exist because water vapour deviates significantly from ideal behaviour under most practical conditions.
People also confuse pressure units regularly. This calculator uses bar (1 bar ≈ atmospheric pressure), but many sources use atmospheres, pascals, or mmHg. Always check your pressure units match what the calculator expects. Similarly, ensure your volume is in litres, not millilitres or cubic metres, to get accurate results.
The Math
Worked examples and deeper derivation
The ideal gas law PV = nRT combines three separate gas laws discovered in the 17th and 18th centuries. Boyle's Law showed pressure and volume are inversely related (P ∝ 1/V). Charles's Law demonstrated volume increases linearly with temperature (V ∝ T). Avogadro's Law proved equal volumes contain equal numbers of molecules at the same conditions (V ∝ n).
Mathematically, these relationships combine as PV/nT = constant for any gas sample. The constant equals R = 0.08314 bar⋅L/(mol⋅K) for all ideal gases. This means doubling pressure halves volume, doubling temperature doubles volume, and doubling the amount of gas doubles volume - if other variables stay constant.
The equation breaks down when gas molecules become significant in size compared to container volume (high pressure) or when intermolecular forces become important (low temperature). Under these conditions, you need more complex equations like van der Waals: (P + a/V²)(V - b) = nRT, where 'a' and 'b' are gas-specific correction factors.
Expert Unlock
The thing most explanations skip
The compressibility factor Z = PV/(nRT) measures how far a real gas deviates from ideality. Z equals 1.0 for perfect ideal behaviour, but drops below 0.3 for CO₂ near its critical point (31°C, 74 bar). Most process engineers apply the Peng-Robinson equation of state instead of PV=nRT when Z deviates more than 5% from unity.
When does the ideal gas law stop being accurate?
Need something this doesn't cover?
Suggest a tool — we'll build it →