Updated on April 19th, 2026

Ideal Gas Law Calculator

Created By Jehan Wadia

V = nRT / P
R = 8.31446261815324 J·mol⁻¹·K⁻¹ (m³·Pa·K⁻¹·mol⁻¹)

Result

V = 22.4140 L

Volume of gas at the specified conditions

Solution Steps
Quick Reference: Standard Conditions
Condition Temperature Pressure Molar Volume
STP (IUPAC) 273.15 K (0 °C) 1 bar (100 kPa) 22.711 L/mol
STP (old/common) 273.15 K (0 °C) 1 atm (101.325 kPa) 22.414 L/mol
NTP 293.15 K (20 °C) 1 atm 24.040 L/mol
Room Conditions 298.15 K (25 °C) 1 atm 24.465 L/mol

Introduction

The Ideal Gas Law is one of the most important equations in chemistry. Written as PV = nRT, it connects four properties of a gas: pressure (P), volume (V), temperature (T), and the amount of gas in moles (n). The letter R stands for the universal gas constant. If you know any three of these values, you can solve for the fourth.

This Ideal Gas Law Calculator makes that process quick and simple. Choose which variable you want to solve for — pressure, volume, temperature, or amount — then enter the three known values. The calculator handles unit conversions automatically, so you can work in atmospheres, liters, Kelvin, Celsius, and many other units without doing the math by hand. It also shows step-by-step solutions so you can follow along and learn how each answer is found.

Whether you are studying for a chemistry test, checking homework answers, or solving gas law problems in a lab setting, this tool gives you accurate results in seconds. It works for any ideal gas calculation at standard or non-standard conditions.

How to Use Our Ideal Gas Law Calculator

Enter any three of the four variables from the ideal gas law equation (PV = nRT), and this calculator will solve for the missing one. It also shows step-by-step work so you can follow the math.

Solve For: Pick which variable you want to find. You can choose Pressure (P), Volume (V), Temperature (T), or Amount of substance (n). The calculator will gray out that field and solve for it using the other three values you provide.

Pressure (P): Enter the gas pressure if it is not the variable being solved. Use the dropdown menu to pick your unit, such as atm, Pa, kPa, bar, mmHg, torr, or psi.

Volume (V): Enter the volume of the gas if it is not the variable being solved. Choose your preferred unit from options like liters (L), milliliters (mL), cubic meters (m³), cubic centimeters (cm³), or gallons.

Temperature (T): Enter the temperature of the gas if it is not the variable being solved. You can input the value in Kelvin (K), Celsius (°C), Fahrenheit (°F), or Rankine (°R). The temperature must be above absolute zero.

Amount of Substance (n): Enter the number of moles of gas if it is not the variable being solved. You can choose between moles (mol) and millimoles (mmol).

Calculate: Click the "Calculate" button or press Enter to get your result. The answer appears in the Result card, and a full breakdown of the solution steps is shown below it, including unit conversions and substitution into the formula.

Reset: Click the "Reset" button to clear all fields and return the calculator to its default settings, which solve for Volume at standard temperature and pressure (1 atm, 273.15 K, 1 mol).

The Ideal Gas Law

The ideal gas law is one of the most important equations in chemistry. It describes how gases behave by connecting four key properties: pressure (P), volume (V), temperature (T), and the amount of gas in moles (n). The equation is written as PV = nRT, where R is the universal gas constant (8.314 J·mol⁻¹·K⁻¹).

This law tells us that if you know any three of the four variables, you can always solve for the missing one. For example, if you know the pressure, temperature, and number of moles of a gas, you can calculate the volume it occupies. The calculator above lets you pick which variable to solve for and handles all the math and unit conversions automatically.

What Is an "Ideal" Gas?

An ideal gas is a simplified model where we assume two things: the gas particles have no size, and they do not attract or repel each other. No real gas is truly ideal, but most common gases — like oxygen, nitrogen, and helium — behave very close to ideal under normal conditions (around room temperature and atmospheric pressure). The ideal gas law becomes less accurate at very high pressures or very low temperatures, where gas particles are squeezed close together and start interacting with each other.

Understanding Each Variable

Standard Temperature and Pressure (STP)

Scientists often compare gases under a set of standard conditions called STP. Under the older, commonly used definition, STP means a temperature of 273.15 K (0 °C) and a pressure of 1 atm. At these conditions, one mole of an ideal gas occupies about 22.414 liters. The updated IUPAC definition uses 1 bar instead of 1 atm, giving a molar volume of 22.711 liters. Both values appear in the reference table within the calculator.

Practical Uses

The ideal gas law is used in many real-world situations. Chemists use it to predict how much gas a reaction will produce. Engineers use it to design pressurized tanks and ventilation systems — often alongside calculations involving force and kinetic energy. Meteorologists rely on it to understand how air pressure and temperature affect weather. Even scuba divers depend on gas law calculations to plan safe dives, where understanding free fall and pressure changes at depth is critical. Whenever you need to relate the pressure, volume, temperature, or amount of a gas, this equation is the starting point.

When verifying your results or reporting experimental findings, you may need to calculate percent error to compare your measured values with theoretical predictions from the ideal gas law. For results involving very large or very small numbers — common in gas calculations — our scientific notation calculator can help you express values clearly and accurately.


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 the number of moles, R is the gas constant (8.314 J·mol⁻¹·K⁻¹), and T is temperature in Kelvin. If you know any three of these values, you can solve for the fourth.

Why does the calculator gray out one of the fields?

The grayed-out field is the variable the calculator is solving for. You pick which variable to find using the "Solve For" buttons at the top. The other three fields stay active so you can type in the known values.

Do I have to enter temperature in Kelvin?

No. You can enter temperature in Kelvin, Celsius, Fahrenheit, or Rankine. The calculator converts your input to Kelvin behind the scenes because the ideal gas law requires Kelvin. Just pick your preferred unit from the dropdown menu next to the temperature field.

Why do I get an error when I enter a negative temperature?

The ideal gas law needs a temperature above absolute zero (0 K or −273.15 °C). If your input converts to zero or a negative number in Kelvin, the equation breaks down because you cannot have zero or negative absolute temperature for a gas.

What value of R does this calculator use?

The calculator uses R = 8.31446261815324 J·mol⁻¹·K⁻¹, which is the same as 8.31446 m³·Pa·K⁻¹·mol⁻¹. This is the accepted value of the universal gas constant. The calculator converts all inputs to SI units (Pa, m³, K, mol) so this value of R works correctly.

Can I use this calculator for real gases?

This calculator assumes the gas behaves ideally. Most common gases like oxygen, nitrogen, and helium behave close to ideal at normal temperatures and pressures. At very high pressures or very low temperatures, real gases deviate from ideal behavior, and you would need a different equation like the van der Waals equation.

How do I find the volume of one mole of gas at STP?

Set the calculator to solve for Volume. Enter Pressure as 1 atm, Temperature as 273.15 K, and Amount as 1 mol. Click Calculate, and you will get about 22.414 liters, which is the molar volume at the old STP definition.

What is the difference between STP and NTP?

STP (Standard Temperature and Pressure) uses 273.15 K (0 °C) and 1 atm. NTP (Normal Temperature and Pressure) uses 293.15 K (20 °C) and 1 atm. Because NTP has a higher temperature, the molar volume is larger — about 24.04 L/mol instead of 22.41 L/mol.

What units can I use for pressure in this calculator?

You can use atm, Pa, kPa, MPa, GPa, bar, decibar, millibar, mmHg, torr, psi, lb/ft², or lb/in². The calculator converts your chosen unit to pascals (Pa) internally and then converts the result back to your selected unit.

What units can I use for volume?

You can choose from liters (L), milliliters (mL), cubic meters (m³), cubic centimeters (cm³), cubic decimeters (dm³), cubic feet (ft³), cubic inches (in³), or US gallons (gal). The calculator converts everything to cubic meters for the math and then converts the answer to your chosen unit.

How do I solve for the number of moles?

Click the "Amount (n)" button under Solve For. Then enter the pressure, volume, and temperature of the gas. Click Calculate, and the tool will find how many moles of gas are present using the formula n = PV / RT.

Why does my answer change when I switch units?

The actual quantity stays the same — only the number changes because different units represent the same amount differently. For example, 1 atm equals 101,325 Pa. If you solve for pressure and switch from atm to Pa, the number gets much larger, but it represents the same pressure.

What does the step-by-step solution show?

The solution steps show the formula used, how each input is converted to SI units, how the values are substituted into the equation, the result in SI units, and then the final conversion to your chosen output unit. This helps you follow the full calculation from start to finish.

Can I enter millimoles instead of moles?

Yes. Use the dropdown next to the Amount field and select "mmol" for millimoles. The calculator will convert millimoles to moles (by dividing by 1000) before using the value in the equation, and it will display results in millimoles if that is your selected unit.

What happens if I enter zero for pressure or volume?

The calculator will show an error because pressure and volume must be positive numbers. A pressure or volume of zero does not make physical sense for a gas, and dividing by zero would make the equation undefined.