Skip to content
Calcipedia

Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, moles, or temperature with STP and SATP presets, unit conversions, molar-volume checks.

Last updated

Ideal gas law calculator Solve PV = nRT for pressure, volume, moles, or temperature. The calculator converts units internally, shows the rearranged formula, and flags when real-gas behaviour may matter.

Solve for (PV = nRT)

Standard-condition presets

Use presets as checks, then change any known value for your gas-law problem.

Temperature

Result

Pressure

0.999998 atm

Treat this as a first-pass ideal-gas estimate: high pressure or low temperature can make real gases deviate noticeably from PV = nRT.

Pressure
0.999998 atm
101324.83 Pa
Volume
22.414 L
22.4140 L
Amount
1 mol
1.0000 mol
Temperature
32 F
273.15 K
Molar volume
22.414 L/mol
Useful STP/SATP check
Formula used
P = nRT / V
Converted internally to Pa, m³, mol, and K using R = 8.31446 J/(mol·K).

Mass and density checks for common gases

Hydrogen (H₂) 2.016 g

0.09 g/L at this state

Helium (He) 4.003 g

0.179 g/L at this state

Nitrogen (N₂) 28.014 g

1.25 g/L at this state

Oxygen (O₂) 31.999 g

1.428 g/L at this state

CO₂ 44.01 g

1.964 g/L at this state

Argon (Ar) 39.948 g

1.782 g/L at this state

← All Physics calculators

Science — Physics

Ideal gas law calculator guide: solve PV = nRT with STP, SATP

The ideal gas law PV = nRT links pressure, volume, amount of substance, and absolute temperature in a single equation. This page also explains the main assumptions behind the ideal gas law calculator result, highlights the supporting figures shown by the calculator, and helps the reader use the estimate without overstating what a quick online tool can prove.

The ideal gas law and rearranged formulas

PV = nRT, where P is pressure, V is volume, n is the amount of substance in moles, R is the universal gas constant (8.31446 J·mol⁻¹·K⁻¹), and T is absolute temperature in Kelvin. All values must use consistent SI units: Pa, m³, mol, and K.

The law combines Boyle's law (PV = constant at fixed T and n), Charles's law (V/T = constant at fixed P and n), and Avogadro's law (V ∝ n at fixed P and T) into a single unified equation.

The calculator rearranges the same equation depending on the unknown: pressure uses P = nRT / V, volume uses V = nRT / P, moles use n = PV / RT, and temperature uses T = PV / nR. Showing the active rearranged formula matters because many gas-law mistakes come from solving the algebra correctly but using the wrong pressure, volume, or temperature unit with the chosen gas constant.

PV = nRT

Ideal-gas equation relating pressure, volume, amount of substance, the molar gas constant, and absolute temperature.

P = nRT / V; V = nRT / P; n = PV / RT; T = PV / nR

The four rearranged forms used when solving for pressure, volume, moles, or temperature.

Worked example: one mole at STP

A standard chemistry benchmark is one mole of gas at 0 °C and 1 atm. Substituting n = 1 mol, T = 273.15 K, and P = 1 atm into PV = nRT gives a volume of about 22.414 L. Running the same values backward through the calculator should return roughly 1 atm, 22.414 L, 1 mol, or 273.15 K depending on which variable you choose to solve for.

That worked example is useful because it checks both the equation and the unit system. If you accidentally enter Celsius where Kelvin is required, or mix litres with cubic metres without converting, the result will be off by a large factor even though the algebra looks correct.

The preset chips use the same idea as a built-in answer key. Start with classic STP, IUPAC STP, SATP, or room-air conditions, then change one known value at a time. If the molar volume changes in the expected direction when pressure or temperature changes, the setup is probably consistent.

Standard conditions, molar volume, and unit choices

At STP (0 °C, 1 atm), one mole of an ideal gas occupies 22.414 litres. At SATP (25 °C, 100 kPa), one mole occupies 24.790 litres. IUPAC-style standard pressure of 100 kPa gives a molar volume near 22.711 L/mol at 0 °C, which is why different textbooks and lab sheets may quote slightly different standard molar volumes.

The calculator reports molar volume in L/mol alongside the solved variable so you can compare your state against familiar reference points. Molar volume is especially helpful when the unknown is not volume: a pressure or moles result can still be checked by asking whether V/n is close to the expected value for the stated temperature and pressure.

You can enter pressure in atm, Pa, kPa, bar, psi, mmHg, or torr; volume in L, mL, m³, cm³, or ft³; and temperature in K, °C, or °F. The internal calculation converts everything to Pa, m³, mol, and K before solving, so you do not need to pick a different numerical R value for every display-unit combination.

Mass, molar mass, and density checks

The ideal gas equation uses moles, not grams. If a problem gives gas mass, convert with n = mass / molar mass before entering the amount of substance. The result panel lists mass estimates for common gases such as hydrogen, helium, nitrogen, oxygen, carbon dioxide, and argon so you can connect the mole result to a practical mass.

Density can also be derived from PV = nRT by combining n = m / M with density = m / V. That gives density = PM / RT, where M is molar mass. The calculator's common-gas density rows are not a substitute for a full gas-property table, but they quickly show why carbon dioxide is denser than nitrogen or oxygen under the same state conditions.

n = mass / molar mass

Convert grams to moles before using PV = nRT.

density = P × M / (R × T)

Ideal-gas density relationship when molar mass M is known.

Standard conditions and real gases

At STP (0 °C, 1 atm), one mole of an ideal gas occupies 22.414 litres. At SATP (25 °C, 100 kPa, the newer standard), one mole occupies 24.790 litres.

Real gases deviate from ideal behaviour at high pressures and low temperatures. For most applications involving air, oxygen, nitrogen, and common gases at moderate conditions, the ideal law is accurate to within a few percent.

Use the result note as a model-quality warning rather than a pass/fail verdict. The ideal-gas law assumes point particles with no intermolecular attraction; real gases depart from those assumptions as molecules get crowded together, cool toward condensation, or interact strongly. For high-accuracy process work, use a real-gas equation of state or measured property data rather than relying on a single ideal-gas calculation.

Common mistakes when using a PV nRT calculator

The most common mistake is entering temperature in Celsius as if it were Kelvin. A temperature of 25 °C must be converted to 298.15 K before the equation is evaluated; using 25 K would describe an extremely cold state and produce a wildly different answer. The calculator accepts °C and °F inputs, but the result panel still shows the Kelvin value so the absolute-temperature conversion is visible.

A second mistake is mixing unit systems inside a hand calculation. If R is 8.314 J·mol⁻¹·K⁻¹, pressure-volume work must be in Pa·m³ because 1 joule equals 1 Pa·m³. Chemistry courses often use R = 0.082057 L·atm·mol⁻¹·K⁻¹ instead; that is fine when pressure is in atm and volume is in litres, but it is the same physical constant expressed in a different unit basis.

A third mistake is treating the ideal gas law as a gas-identity calculator. PV = nRT does not say whether the gas is nitrogen, oxygen, carbon dioxide, or a mixture. Gas identity matters for mass and density through molar mass, and it matters for real-gas deviations through molecular size and intermolecular attractions.

Frequently asked questions

What is the ideal gas law formula?

The ideal gas law formula is PV = nRT. P is pressure, V is volume, n is amount of substance in moles, R is the molar gas constant, and T is absolute temperature in Kelvin. The calculator rearranges the same formula to solve for pressure, volume, moles, or temperature.

How do I use this PV nRT calculator?

Choose the variable you want to solve for, enter the other three known values, and pick the units attached to those values. For example, to find pressure, enter volume, moles, and temperature. The calculator converts the inputs to Pa, m³, mol, and K, solves the rearranged equation, and converts the answer back to your selected result unit.

When does the ideal gas law break down?

The ideal gas law assumes gas molecules have no volume and no intermolecular attractions. Real gases deviate most when pressure is high, temperature is low, or the gas is close to condensation. A van der Waals or other real-gas equation of state is more appropriate when those effects matter.

Why must temperature be in Kelvin?

The ideal gas law requires absolute temperature (Kelvin) because pressure and volume are proportional to the absolute kinetic energy of the gas molecules. Using Celsius would imply negative energy at temperatures below 0 °C, which is physically meaningless. If your input is in °C or °F, convert it to K before using PV = nRT; this calculator does that conversion internally.

What value of R should I use for the ideal gas law?

Use an R value that matches your pressure and volume units. In SI, R = 8.31446 J·mol⁻¹·K⁻¹, which is equivalent to Pa·m³ per mol per K. In many chemistry problems, R is written as 0.082057 L·atm·mol⁻¹·K⁻¹. This calculator avoids the mismatch by converting every input to the SI basis before solving.

What is the difference between STP and SATP?

Classic STP is commonly taught as 0 °C and 1 atm, where one mole of an ideal gas occupies about 22.414 L. SATP is commonly used as 25 °C and 100 kPa, where one mole occupies about 24.790 L. Some standards use 100 kPa at 0 °C, giving a molar volume near 22.711 L/mol. Always match the standard condition to the convention used in your course, lab, or reference.

How do I calculate moles from pressure, volume, and temperature?

Rearrange PV = nRT to n = PV / RT. Convert pressure, volume, and temperature to a consistent unit basis, then divide the pressure-volume product by R times absolute temperature. The result is the amount of substance in moles.

Can I use the ideal gas law for gas mixtures?

Yes, for a first-pass total-state calculation, use the total number of moles in the mixture. PV = nRT gives the relationship between total pressure, total volume, total moles, and temperature. If you need partial pressures for each gas, combine the ideal gas law with mole fractions and Dalton's law rather than treating the mixture as a single pure gas.

How do I convert gas mass to moles?

Use n = mass / molar mass. For example, 32 g of oxygen gas is about 1 mol because O₂ has a molar mass near 31.999 g/mol. PV = nRT cannot use grams directly; grams must be converted to moles first.

How do I find gas density using PV = nRT?

Combine PV = nRT with n = mass / molar mass and density = mass / volume. The result is density = PM / RT, where M is molar mass. Density rises with pressure and molar mass, and falls as absolute temperature increases.

Is this the same as a combined gas law calculator?

It overlaps with combined gas law work, but it is not exactly the same. The combined gas law compares two states for the same amount of gas, usually P₁V₁/T₁ = P₂V₂/T₂. The ideal gas law includes moles explicitly, so it can solve amount-of-substance problems as well as pressure, volume, and temperature problems.

Also in Physics

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.