Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, moles, or temperature. Enter any three values, switch units freely, and get molar volume, gas density, and internal energy with worked steps.

https://hexacalculator.com/calculators/physics/thermodynamics/ideal-gas-law-calculator

Physics

Thermodynamics

Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, moles, or temperature. Enter any three values, switch units freely, and get molar volume, gas density, and internal energy with worked steps.

Ideal Gas Law Calculator

Unit
Unit
Unit
Unit

Enter any three of pressure, volume, amount, and temperature, and leave the unknown blank. The calculator solves for the missing one and reports it in your chosen units.

Add mass and density

Use the gas's molar mass to find the mass of the sample and its density.

Add thermal energy

Add the internal (thermal) energy of the gas from kinetic theory, for a monatomic and a diatomic gas.

Please input values into the fields

Was this calculator helpful?

It takes one click and shapes what we fix next.

Add as preferred on Google

Show the pressure-volume curve

Boyle's law: at fixed temperature and amount, pressure and volume trade off along an inverse curve. The curve is drawn for your own gas.

This ideal gas law calculator allows you to calculate any one of the variables in the equation PV = nRT given that you know three of them. Enter three values (pressure, volume, number of moles, temperature) and leave the fourth blank to solve for it.

Ideal Gas Law - Introduction
Ideal Gas Law - Introduction

The tool also calculates molar volume, number of molecules, mass and density of the gas as well as internal energy and creates a pressure-volume graph.

What is the equation of state for ideal gases?

The ideal gas law relates four quantities describing a gas: pressure, volume, amount of substance, and temperature. These are related by a single simple equation.

Ideal Gas Law - Explainer
Ideal Gas Law - Explainer

The Ideal Gas Law describes an idealized gas whose molecules take up no space and exert no attractive or repulsive forces on each other. No real gases are perfectly ideal, but at normal temperatures and pressures most gases behave very close to the ideal state. For this reason, this law is very useful in physics and chemistry.

The ideal gas law.

The value that is obtained by multiplying pressure and volume is equal to the value that is obtained by multiplying the amount of a gas with the gas constant and the absolute temperature.

PV=nRTPV = nRT
Ideal Gas Law - Formula
Ideal Gas Law - Formula

where P is the absolute pressure, V is volume, n is amount of substance (measured in moles), and T is the absolute temperature while R is the gas constant. This law combines three simpler observations: that volume increases with increasing amounts of gas, that volume decreases as pressure increases, and that pressure increases as temperature increases.

The gas constant R

R is a proportionality constant that makes sure the equation holds true at equilibrium. It's constant for any given gas.

R=8.314462618 Jmol⋅K=8.314462618 Pa⋅m3mol⋅KR = 8.314462618\ \tfrac{\text{J}}{\text{mol}\cdot\text{K}} = 8.314462618\ \tfrac{\text{Pa}\cdot\text{m}^3}{\text{mol}\cdot\text{K}}

The value of R depends on the units for the other quantities. This calculator converts all quantities to SI units (pascals, cubic meters, moles, kelvins), calculates R = 8.314462618, then outputs the result in the selected units. In chemistry, R is often quoted as 0.082057 liter·atmospheres/mole·kelvin. This is the same constant when pressure is given in atmospheres and volume in liters.

To use this calculator:

Enter any three known quantities. For each quantity you can either enter the unit that is most appropriate for your problem or leave it blank. Leave the desired quantity blank.

When three values are entered the calculator will instantly calculate and display the missing result. A pressure value is also displayed along with a simple word summary of the state of the gas. To calculate another value simply leave one field blank. No mode selection is required as the blank field tells the calculator which value to calculate.

Each variable can be determined individually.

Since this formula contains four variables it can be converted into an equation that can solve for any one of the variables. The calculator uses the following four formulas:

P=nRTVV=nRTPn=PVRTT=PVnRP = \frac{nRT}{V} \qquad V = \frac{nRT}{P} \qquad n = \frac{PV}{RT} \qquad T = \frac{PV}{nR}

To find

Formula

In words

Pressure P

P = nRT / V

Amount times R times temperature, over volume

Volume V

V = nRT / P

Amount times R times temperature, over pressure

Amount n

n = PV / (RT)

Pressure times volume, over R times temperature

Temperature T

T = PV / (nR)

Pressure times volume, over amount times R

Use absolute pressure and temperature:

There are two important things that determine whether the result is correct or not. The pressure must be absolute, which means it's measured relative to a perfect vacuum, rather than gauge pressure as shown on a tire pressure gauge. To get the absolute pressure you need to add in atmospheric pressure. Absolute pressure will be roughly equal to gauge pressure plus 101.3 kPa, or one standard atmosphere.

The temperature must be an absolute temperature and is measured in Kelvin. The Celsius temperature can be zero or negative which will cause the equation to not work if it is not converted first. To convert a Celsius temperature into Kelvin, add 273.15. This calculator automatically does this conversion for you when you select Celsius or Fahrenheit but never forget about this when doing manual calculations.

T[K]=T[∘C]+273.15T[\text{K}] = T[^{\circ}\text{C}] + 273.15

Units and Conversions

Gas-related problems can easily have different units used, so the calculator will accept common units for each quantity and convert as necessary. The main conversions are:

Quantity

Common units

Key conversion

Pressure

Pa, kPa, bar, atm, mmHg, torr, psi

1 atm = 101,325 Pa = 760 mmHg = 14.696 psi

Volume

m3, L, mL, gallons

1 L = 0.001 m3; 1 m3 = 1,000 L

Temperature

K, C, F

T[K] = T[C] + 273.15

Amount

mol, mmol

1 mol = 6.022 x 10^23 molecules

Example - Calculation of molar volume at standard temperature and pressure (STP)

One mole of any ideal gas is brought to standard conditions, i.e. the standard temperature and pressure, 0 degrees Celsius (273.15 K) and a standard atmospheric pressure.

Ideal Gas Law - Example
Ideal Gas Law - Example

What volume does it have then? Determine V.

V=nRTP=(1)(8.314462618)(273.15)101325≈0.022414 m3=22.414 LV = \frac{nRT}{P} = \frac{(1)(8.314462618)(273.15)}{101325} \approx 0.022414\ \text{m}^3 = 22.414\ \text{L}
Ideal Gas Law - Calculation
Ideal Gas Law - Calculation

The value of 22.414 liters per mole is a well known ideal molar volume at standard temperature and pressure (STP) and it's worth knowing. This calculator shows the molar volume under any conditions so you can see how it changes with changing temperature and pressure.

Second example - calculation of pressure

0.750 moles of a gas occupies a volume of 8.0 liters and has a temperature of 40 degrees C, which is 313.15 K. What is the pressure?

P=nRTV=(0.750)(8.314462618)(313.15)0.00800≈244,094 Pa≈2.409 atmP = \frac{nRT}{V} = \frac{(0.750)(8.314462618)(313.15)}{0.00800} \approx 244{,}094\ \text{Pa} \approx 2.409\ \text{atm}

If you enter the three known values and release the pressure while selecting "atmospheres" as your unit for the pressure, you will get a result of about 2.409 atm. If you change the unit to kilopascals, the same result is shown with about 244.1 kPa.

Molar volume, density and molar mass:

When the state of a gas is known, some other quantities can be easily determined. The molar volume is obtained by dividing the volume by the amount of substance. The mass of a sample is the product of the amount of substance of the gas and its molar mass, and the density is obtained by dividing the mass by the volume.

Ideal Gas Law - Different Gases
Ideal Gas Law - Different Gases

You can display both of these quantities simultaneously by opening the Mass and Density section, selecting a gas or entering a molar mass. In the case of an ideal gas, the density can be directly derived from the equation of state.

ρ=mV=PMRT\rho = \frac{m}{V} = \frac{PM}{RT}
Ideal Gas Law - Density
Ideal Gas Law - Density

where M is the molar mass. This is the relationship used in chemistry to determine density and molar mass using the ideal gas law equation. If you weigh a known volume of a gas and measure its pressure and temperature, then you can solve for the unknown molar mass of the gas.

The law of the ideal gas equation (PV=nRT).

The ideal gas law equation combines the classical gas laws. Each of these laws holds two of the variables constant and observes how the remaining two change.

Law

Held constant

Relationship

Boyle's law

amount, temperature

P and V are inversely related (PV is constant)

Charles's law

amount, pressure

V is proportional to T

Gay-Lussac's law

amount, volume

P is proportional to T

Avogadro's law

pressure, temperature

V is proportional to n

Combined gas law

amount

PV / T is constant

Boyle's law is intuitively understood by the pressure-volume curve of a computational tool. If the amount and temperature of a gas remain constant, then the pressure and volume change inversely with each other.

Kinetic theory of gases and energy.

The ideal gas law is derived from the kinetic theory of gases. This theory regards a gas as an assembly of tiny particles that are in constant and random motion. The particles undergo elastic collisions with each other and do not interact between collisions. Temperature is a measure of the average kinetic energy of the particles, and it is this which causes a higher temperature gas to exert more pressure on its container.

For an ideal monoatomic gas the internal energy is three halves of nRT. This is because particles can move in three directions. For a diatomic gas rotation is also possible, adding two rotational modes giving five halves of nRT at normal temperatures. These two results are shown on the thermal energy diagram. Note that this energy depends only on temperature and amount of gas.

When do real gases start to deviate from these laws?

The ideal gas equation of state is an approximation and it becomes more accurate the less dense the gas is. At high temperatures and low pressures the molecules are further apart from each other and there are fewer interactions between them.

When a gas is highly compressed, or cooled to near the condensation point, its accuracy decreases. In this case, the volume of the molecules themselves and the attraction between them becomes important, and more accurate models such as the van der Waals equation are required. Still, for most laboratory and classroom problems, an ideal gas law is sufficient with a few percent accuracy.

Applications of the ideal gas law equation:

This one equation can solve a lot of problems. Chemists use this equation to calculate stoichiometry when gases are produced or consumed in reactions and it is also used in the laboratory to determine the molar mass and density of gases.

Engineers use this equation to determine the dimensions of pressure vessels, design engines and predict how gases will behave when heated or pressurized. It also explains why there are warnings not to heat containers, why balloons shrink in cold environments and how divers' air supply under water depends on depth. Whenever the pressure, volume or temperature of a gas changes, PV = nRT is the starting point.

Tips for getting accurate results:

Before using the calculation results, be sure to convert the pressure into absolute pressure and the temperature into Kelvin. These are the most common sources of error. Leave the conversions to the calculation tool and avoid manual calculations with mixed units.

Check to see if the result makes physical sense. Pressure, volume, amount of gas, and absolute temperature should all be positive values. Also note that results are based on assuming the gas behaves like an ideal gas. So for gases near their boiling point, results should be considered very rough estimates rather than exact values.

Frequently asked questions

What is the equation of state for an ideal gas?

The ideal gas law is PV = nRT where P is the absolute pressure, V is volume, n is amount of substance in moles, T is the absolute temperature and R is the gas constant which has a value of 8.314462618 Joule per mole-Kelvin. If three out of four quantities (P, V, n, T) are known then the equation can be rearranged to calculate the remaining quantity.

What is the value of the gas constant R?

The gas constant R is equal to 8.314462618 joules per mole kelvin. In SI units this is equivalent to 8.314462618 pascals cubic meters per mole kelvin. It is commonly given in chemistry as 0.082057 liter atmospheres per mole kelvin. The value used depends on the units for pressure and volume. This calculator converts to SI units, performs the calculations, then outputs the result in the original units.

Why does the temperature have to be in kelvin for the ideal gas law?

This equation uses absolute temperature. Absolute temperature is a temperature measured from absolute zero and always has a positive value. Celsius and Fahrenheit can have values of zero or negative, which would give nonsensical results in the equation. Therefore, the Celsius value must be increased by 273.15 to convert it into Kelvin. The calculator automatically converts Celsius and Fahrenheit to Kelvin.

How do you calculate density or molar mass of a gas?

The ideal gas law is rearranged so that the density is equal to P times M divided by R times T. If the molar mass is known, then the mass and density tab on the calculator will directly give you the density. If the density of a gas is measured at a known pressure and temperature, then the molar mass can be calculated from the same equation. This is one method for identifying unknown gases.

What is STP and what is the molar volume of a gas at STP?

STP stands for Standard Temperature and Pressure. At 0 degrees Celsius (273.15 K) and a pressure of 1 atmosphere, one mole of an ideal gas occupies about 22.414 liters. This is the molar volume at STP. According to newer IUPAC standards, the molar volume at 1 bar is approximately 22.711 liters. If you enter a mole under these conditions, the tool will recalculate the corresponding molar volume.

When does the ideal gas law no longer apply?

The ideal gas equation of state is very accurate for gases at low pressure and high temperature, where the gas molecules are far apart. At higher pressures or lower temperatures, approaching the liquefaction point for the gas, molecular size and intermolecular forces become important, and the equation of state becomes less accurate. Such situations can be described by more detailed models such as the van der Waals equation.

Related calculators

Disclaimer: This calculator is provided for general informational and educational purposes only. Our calculators are under active development, and results may be inaccurate, incomplete, or unsuitable for your situation. Always verify the figures independently and seek advice from a qualified professional before relying on them. We make no warranties and accept no liability for any loss or decision arising from use of this tool.

References

  1. Wikipedia: Ideal gas law

    Definition, the equation of state, the gas constant, the kinetic-theory derivation, and the special gas laws.

  2. NIST: CODATA value of the molar gas constant

    The official value of R, 8.314462618 J/(mol K).

  3. HyperPhysics: Ideal Gas Law

    A concise reference on the gas law, molar volume, and kinetic theory.