Ideal Gas Law Calculator - Solve PV = nRT | Free Online Tool

Free online gas law calculator. Solve for pressure, volume, moles, or temperature using the ideal gas equation (PV = nRT). Instant unit conversion. Perfect for chemistry students, lab technicians, and anyone working with gas calculations.

Input Values (PV = nRT)

Calculated Result

Enter at least 3 values to calculate the missing one

What Is the Ideal Gas Law Calculator and Why Do You Need One?

An Ideal Gas Law calculator (also called a PV = nRT calculator orgas law solver) is an online tool that solves the fundamental equation of state for an ideal gas. The ideal gas law, expressed as PV = nRT, relates the pressure (P), volume (V), temperature (T), and number of moles (n) of a gas through the universal gas constant (R = 8.314 J/(mol·K)). This equation is one of the cornerstones of chemistry and thermodynamics, providing a simple yet powerful way to predict gas behavior under various conditions.

Whether you are a high school or college chemistry student, a laboratory technician, a researcher, or a professional working with pressurized systems, you will frequently need to solve gas law problems. Our free online gas law calculator allows you to enter any three of the four variables (P, V, n, T) and instantly calculates the fourth - eliminating algebraic errors and tedious unit conversions. It also supports verification mode: if you enter all four values, the calculator checks whether they satisfy the PV = nRT equation with high precision.

This ideal gas equation solver operates entirely within your browser - no data is sent to any server, ensuring your privacy and enabling offline use. It supports 7 pressure units (Pa, kPa, MPa, atm, bar, mmHg, psi), 6 volume units (m³, L, mL, cm³, ft³, gal), and 3 temperature units (K, °C, °F) - all automatically converted to base SI units before the calculation. Whether you are doing stoichiometry, studying gas‑phase reactions, or designing industrial equipment, this tool is your go‑to solution for ideal gas law problems.

How to Use This Free Online Gas Law Calculator

Using this PV = nRT calculator is straightforward:

  1. Enter any three of the four values: Pressure (P), Volume (V), Moles (n), or Temperature (T).
    Leave the fourth field empty - the calculator will solve for it.
  2. Select the appropriate unit for each variable using the dropdown menus.
  3. The missing variable is calculated instantly as you type (auto‑calculation).
  4. If you enter all four values, the calculator will verify whether they satisfy the PV = nRT equation.
  5. Copy the result using the copy button, or use the “Clear All” button to reset everything.

Example: Suppose you have 2.00 moles of an ideal gas at 300 K in a 0.500 m³ container. To find the pressure, you would enter n = 2.00, T = 300 K, V = 0.500 m³, leave P empty, and the calculator will compute the pressure in your selected unit.

Note: Temperature must be entered in Kelvin (K) for the equation to work directly; however, our calculator automatically converts Celsius (°C) and Fahrenheit (°F) to Kelvin internally.

The Ideal Gas Law - PV = nRT Explained

PV = nRT
Pressure × Volume = Moles × Gas Constant × Temperature

The ideal gas law is an equation of state for an ideal gas - a hypothetical gas where molecules have zero volume and do not interact except through perfectly elastic collisions. While no real gas is perfectly ideal, many common gases (air, nitrogen, oxygen, hydrogen) behave very close to ideal at ordinary temperatures and pressures, making the equation highly useful.

The equation can be rearranged to solve for any variable:

  • Find pressure: P = nRT / V
  • Find volume: V = nRT / P
  • Find number of moles: n = PV / (RT)
  • Find temperature: T = PV / (nR)

The universal gas constant R is a fundamental physical constant with the value 8.314462618 J·mol⁻¹·K⁻¹ (exactly when using SI units). For historical and practical reasons, R also appears in other forms, such as 0.082057 L·atm·mol⁻¹·K⁻¹ when pressure is in atmospheres and volume in liters. Our calculator uses R = 8.314 J/(mol·K) internally after converting your inputs to SI units.

All Supported Units - Complete Reference Tables

Pressure Units

UnitSymbolValue in PaCommon Uses
PascalPa1SI base unit, stress analysis
KilopascalkPa1,000Engineering, tyre pressure (most countries)
MegapascalMPa1,000,000Material strength, hydraulics
Atmosphereatm101,325Standard atmospheric pressure, chemistry
Barbar100,000Meteorology, diving, industrial processes
Millimeter of mercurymmHg133.322Blood pressure, barometers, vacuum systems
Pounds per square inchpsi6,894.76Tyre pressure (US), air tools, plumbing

Volume Units

UnitSymbolValue in m³Common Uses
Cubic meter1SI base unit, construction, billing
LiterL0.001Standard lab unit, beverages
MillilitermL1 × 10⁻⁶Medicine, chemistry lab, pipettes
Cubic centimetercm³1 × 10⁻⁶Equivalent to mL, engine displacement
Cubic footft³0.0283168Construction, HVAC, gas appliances
Gallon (US)gal0.00378541Fuel, large containers (US)

Temperature Units

UnitSymbolValue in KCommon Uses
KelvinKTSI base unit, thermodynamics, science
Celsius°CT + 273.15Weather, cooking, everyday life
Fahrenheit°F(T − 32) × 5/9 + 273.15US weather, baking, body temperature

The Gas Constant (R) - Multiple Forms Explained

The universal gas constant (R) is a proportionality constant that appears in the ideal gas law. Its numerical value depends on the units used for pressure, volume, and energy. The SI value is R = 8.314462618 J·mol⁻¹·K⁻¹, which is exact under the 2019 redefinition of SI units. However, for many practical chemistry calculations, the value R = 0.082057 L·atm·mol⁻¹·K⁻¹ is more convenient when working with liters and atmospheres.

Value of RUnitsWhen to Use
8.314J·mol⁻¹·K⁻¹SI: Pa, m³, K, moles
8.314m³·Pa·mol⁻¹·K⁻¹SI: Pa, m³ (identical to J)
0.082057L·atm·mol⁻¹·K⁻¹Common in chemistry: L, atm, K
62.364L·mmHg·mol⁻¹·K⁻¹When pressure is in torr/mmHg
8.314cm³·MPa·mol⁻¹·K⁻¹When pressure is in MPa, volume in cm³

Our calculator always uses R = 8.314 J/(mol·K) internally, but it automatically converts your chosen pressure and volume units to Pa and m³ before performing the calculation. This ensures maximum accuracy without you having to remember which R value to use.

Real‑World Applications of the Ideal Gas Law

1. Chemistry Laboratory

The ideal gas law is used to determine the number of moles of gas produced in a reaction, calculate the molar mass of a volatile substance, and predict how gas volume changes with temperature or pressure in closed systems. For example, finding the volume of CO₂ generated when an antacid tablet dissolves.

2. Engineering and Industrial Processes

Engineers use the ideal gas law to design pressurized tanks, gas pipelines, combustion engines, HVAC systems, and compressed air systems. Knowing how pressure and temperature affect gas volume is essential for safety and efficiency.

3. Meteorology and Atmospheric Science

Weather forecasters use the ideal gas law to understand air pressure changes with altitude, which helps predict wind patterns and storm formation. Rising warm air (lower density) leads to low surface pressure and often precipitation.

4. Respiratory and Medical Applications

Anesthesia machines, ventilators, and oxygen cylinders all rely on gas law calculations. The volume of gas delivered to a patient must be accurately calculated from pressure and temperature conditions.

5. SCUBA Diving

Divers use the ideal gas law to estimate how long their air supply will last at depth, where increased pressure causes the gas to be consumed more quickly than at the surface. The calculator can help plan safe dive profiles.

Real‑Gas Deviations - When the Ideal Gas Law Fails

The ideal gas law is an approximation that works best underlow pressures and high temperatures. Under these conditions, gas molecules are far apart and move so quickly that intermolecular attractions and molecular volume become negligible.

At high pressures (e.g., above 100 atm) or low temperatures(near the condensation point), real gases deviate significantly from ideal behavior:

  • Intermolecular attractions cause the volume to be smaller than predicted (PV less than nRT).
  • Molecular volume (size of gas molecules) becomes significant, causing the volume to be larger than predicted (PV greater than nRT).

For very precise work at extreme conditions, engineers use more complex equations of state, such as the van der Waals equation (which adds correction terms for molecular attraction and volume), the Redlich‑Kwong equation, or the Peng‑Robinson equation. However, for most educational and practical engineering applications at normal temperatures and pressures (0–200 °C, 1–50 atm), the ideal gas law provides excellent accuracy.

Common Gas Law Problems - Example Calculations

Example 1: Finding Volume at STP

Calculate the volume of 1.00 mole of an ideal gas at standard temperature and pressure (STP = 0 °C = 273.15 K, 1 atm). Using PV = nRT:

V = nRT / P = (1.00 mol × 0.082057 L·atm·mol⁻¹·K⁻¹ × 273.15 K) / 1.00 atm = 22.41 L

This is the well‑known molar volume of an ideal gas at STP.

Example 2: Finding Pressure

A 5.00 L container holds 0.400 mol of an ideal gas at 25 °C (298.15 K). Find the pressure in atm.

P = nRT / V = (0.400 mol × 0.082057 × 298.15 K) / 5.00 L = 1.96 atm

Example 3: Finding Moles

Calculate the number of moles of gas in a 22.4 L container at 1 atm and 273 K.

n = PV / RT = (1.00 atm × 22.4 L) / (0.082057 × 273.15 K) = 1.00 mol

Frequently Asked Questions (FAQ) About the Ideal Gas Law

How do I use the ideal gas law to solve for pressure?

Rearrange the equation to P = nRT / V. Convert all units to consistent values (e.g., pressure in Pa or atm, volume in m³ or L, temperature in K), and then calculate. Our calculator does all of this automatically.

Why must temperature be in Kelvin for the ideal gas law?

The Kelvin scale is an absolute temperature scale starting at absolute zero (0 K). Using Celsius would give incorrect results because the proportional relationship between gas volume and temperature fails when the scale does not start at the absolute zero point. Our calculator automatically converts °C and °F to Kelvin.

What is the value of the gas constant R in different units?

Common values include: 8.314 J·mol⁻¹·K⁻¹ (SI), 0.082057 L·atm·mol⁻¹·K⁻¹(chemistry), and 62.364 L·mmHg·mol⁻¹·K⁻¹ (when pressure is in mmHg). Our calculator always uses the SI value internally after unit conversion, so you never need to look up the correct R.

How accurate is this gas law calculator?

The calculator uses the exact value of R = 8.314462618 J·mol⁻¹·K⁻¹ (the 2019‑definition exact value) and performs unit conversions using standard, internationally recognized conversion factors (e.g., 1 atm = 101325 Pa exactly). Results are displayed to 6 decimal places, which is more than sufficient for educational and most engineering applications.

Can I use this calculator to verify my homework or lab results?

Yes. Enter the three values you know, and the calculator will compute the fourth, providing a quick check of your manual calculation. Alternatively, enter all four values - the calculator will confirm whether they satisfy PV = nRT within the selected unit system.

Does this calculator work offline?

Yes. Once the page has loaded, all calculation logic runs locally in your browser. No internet connection is required after the initial page load - perfect for lab use, homework sessions, or field work.

Why Choose Our Ideal Gas Law Calculator?

  • Completely free, no registration. Unlimited calculations with no hidden costs.
  • Privacy‑first design. All calculations happen locally in your browser. Your data never leaves your device.
  • Supports 7 pressure units, 6 volume units, and 3 temperature units - covering all common unit systems.
  • Solves for any variable (P, V, n, T) or verifies the equation when all four are entered.
  • High precision (6 decimal places) using the exact ideal gas law formula.
  • Works offline after initial page load.
  • Fully responsive design with resizable panels on desktop for custom workflow.