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
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:
- 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. - Select the appropriate unit for each variable using the dropdown menus.
- The missing variable is calculated instantly as you type (auto‑calculation).
- If you enter all four values, the calculator will verify whether they satisfy the PV = nRT equation.
- 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
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
| Unit | Symbol | Value in Pa | Common Uses |
|---|---|---|---|
| Pascal | Pa | 1 | SI base unit, stress analysis |
| Kilopascal | kPa | 1,000 | Engineering, tyre pressure (most countries) |
| Megapascal | MPa | 1,000,000 | Material strength, hydraulics |
| Atmosphere | atm | 101,325 | Standard atmospheric pressure, chemistry |
| Bar | bar | 100,000 | Meteorology, diving, industrial processes |
| Millimeter of mercury | mmHg | 133.322 | Blood pressure, barometers, vacuum systems |
| Pounds per square inch | psi | 6,894.76 | Tyre pressure (US), air tools, plumbing |
Volume Units
| Unit | Symbol | Value in m³ | Common Uses |
|---|---|---|---|
| Cubic meter | m³ | 1 | SI base unit, construction, billing |
| Liter | L | 0.001 | Standard lab unit, beverages |
| Milliliter | mL | 1 × 10⁻⁶ | Medicine, chemistry lab, pipettes |
| Cubic centimeter | cm³ | 1 × 10⁻⁶ | Equivalent to mL, engine displacement |
| Cubic foot | ft³ | 0.0283168 | Construction, HVAC, gas appliances |
| Gallon (US) | gal | 0.00378541 | Fuel, large containers (US) |
Temperature Units
| Unit | Symbol | Value in K | Common Uses |
|---|---|---|---|
| Kelvin | K | T | SI base unit, thermodynamics, science |
| Celsius | °C | T + 273.15 | Weather, cooking, everyday life |
| Fahrenheit | °F | (T − 32) × 5/9 + 273.15 | US 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 R | Units | When to Use |
|---|---|---|
| 8.314 | J·mol⁻¹·K⁻¹ | SI: Pa, m³, K, moles |
| 8.314 | m³·Pa·mol⁻¹·K⁻¹ | SI: Pa, m³ (identical to J) |
| 0.082057 | L·atm·mol⁻¹·K⁻¹ | Common in chemistry: L, atm, K |
| 62.364 | L·mmHg·mol⁻¹·K⁻¹ | When pressure is in torr/mmHg |
| 8.314 | cm³·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:
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.
Example 3: Finding Moles
Calculate the number of moles of gas in a 22.4 L container at 1 atm and 273 K.
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.
Related Tools
Discover more free developer tools that might interest you.
Concentration Calculator
Calculate chemical concentrations
Use ToolDensity Calculator
Calculate density from mass and volume
Use ToolDilution Calculator
Calculate solution dilutions
Use ToolHalf-Life Calculator
Calculate remaining amount, time, or half-life for exponential decay
Use ToolMolality Calculator
Calculate molality of solutions
Use ToolMolarity Calculator
Calculate molarity of solutions
Use ToolRelated guides
Read the how-to, then come back to this tool when you are ready to run it locally.
- How to Use the Ideal Gas Law (PV = nRT)Rearrange PV = nRT, watch units, and solve for unknowns locally.
- Best Chemistry Calculators for Lab and HomeworkRoute stoichiometry, molarity, pH, dilution, and gas-law problems to the right DevOkk page. A hub roundup for the chemistry cluster with worked examples and comparison links.
- Best Scientific Calculators for Chemistry and PhysicsMolarity, pH, gas law, force, and energy calculators for lab and class. Run the math in your browser with worked examples.