# Ideal Gas Law Calculator (PV = nRT, Combined Gas Law, Steps) Source: https://www.albert.io/blog/ideal-gas-law-calculator/ · Updated November 30, 2026 ## The tool Ideal Gas Law Calculator: Solve PV = nRT for any variable, use the combined gas law, or find a gas's density and molar mass. It runs in the browser on https://www.albert.io/blog/ideal-gas-law-calculator/ (free, no account). Nothing typed into it is sent to Albert. This free ideal gas law calculator helps chemistry, AP Chemistry and AP Physics 2 students solve PV = nRT for pressure, volume, moles or temperature, work combined gas law problems, and find a gas's density or molar mass, in whatever units the problem uses. ## How to use the Ideal Gas Law Calculator 1. **Pick the law.** Choose PV = nRT for one set of conditions, the combined gas law when a gas changes from one state to another, or density and molar mass. 2. **Choose what to solve for.** The unknown shows a question mark. Fill in everything else. 3. **Use the problem's units.** Pick atm, kPa, mmHg or torr for pressure, L or mL for volume, and K, °C or °F for temperature. For moles, you can enter grams plus the gas's formula instead. 4. **Read the answer and the steps.** The result also shows the answer in other units, and the steps show every conversion and the value of R used. ## Worked example What volume does 1.00 mol of an ideal gas take up at 273.15 K and 1.00 atm? 1. Rearrange PV = nRT for volume: V = nRT ÷ P. 2. Substitute: V = (1.00 mol)(0.082057 L·atm/(mol·K))(273.15 K) ÷ 1.00 atm. 3. Multiply and divide: V = **22.41 L**. That's the molar volume of a gas at standard temperature and pressure (STP), and it's the example the calculator opens with. ## The ideal gas law, variable by variable The ideal gas law ties together the four things that describe a sample of gas: **PV = nRT** | Symbol | Quantity | Units used with R = 0.082057 | | --- | --- | --- | | P | Pressure | atm | | V | Volume | L | | n | Amount of gas | mol | | R | Gas constant | 0.082057 L·atm/(mol·K) | | T | Temperature | K | If you know any three of P, V, n and T, you can solve for the fourth by rearranging: P = nRT ÷ V, V = nRT ÷ P, n = PV ÷ RT, and T = PV ÷ nR. ### Choosing R and converting units R's value depends on the units, so the units in your problem have to match the R you use. With pressure in atm and volume in liters, R = 0.082057 L·atm/(mol·K). With pressure in kPa and volume in liters, R = 8.314 L·kPa/(mol·K), which is the same number as 8.314 J/(mol·K) because 1 L·kPa equals 1 joule. The common conversions: - 1 atm = 101.325 kPa = 760 mmHg = 760 torr - 1 L = 1000 mL - K = °C + 273.15, and °C = (°F − 32) × 5/9 - moles = grams ÷ molar mass Temperature must always be in kelvins. The gas laws are about temperature measured from absolute zero, so a Celsius value would give nonsense: 0 °C would make the volume 0. A temperature at or below 0 K (−273.15 °C) can't exist, so the calculator refuses it. ### A problem with mixed units How many moles of gas are in a 500 mL flask at 25 °C and 750 mmHg? Convert first: P = 750 ÷ 760 = 0.9868 atm, V = 500 ÷ 1000 = 0.500 L, and T = 25 + 273.15 = 298.15 K. Then n = PV ÷ RT = (0.9868 atm)(0.500 L) ÷ [(0.082057 L·atm/(mol·K))(298.15 K)] = 0.02017 mol. The most common mistakes on problems like this are forgetting the 273.15, leaving the volume in mL, and using 8.314 with a pressure in atm. ## The combined gas law When the same sample of gas moves from one set of conditions to another, the amount n doesn't change, so nR is constant and **P₁V₁ ÷ T₁ = P₂V₂ ÷ T₂** If one quantity also stays the same, it cancels and you get one of the classic laws: | Held constant | Law | Equation | | --- | --- | --- | | Temperature | Boyle's law | P₁V₁ = P₂V₂ | | Pressure | Charles's law | V₁ ÷ T₁ = V₂ ÷ T₂ | | Volume | Gay-Lussac's law | P₁ ÷ T₁ = P₂ ÷ T₂ | In the calculator, leave both values of the constant quantity blank. For example, a balloon holding 2.0 L at 27 °C is warmed to 127 °C at constant pressure. Leave both pressures blank, and Charles's law gives V₂ = 2.0 L × 400.15 K ÷ 300.15 K = 2.666 L. The temperatures have to be in kelvins here too. Using 27 and 127 directly would wrongly predict almost five times the volume. Pressure and volume can use any units in the combined law, as long as each matches its partner, because the units cancel. Temperature is the exception: it must be absolute. ## Gas density and molar mass Moles are mass divided by molar mass (n = m ÷ M), and density is mass divided by volume (d = m ÷ V). Substituting both into PV = nRT gives **PM = dRT** So you can find an unknown gas's molar mass from its density, M = dRT ÷ P, or predict a known gas's density, d = PM ÷ RT. A gas with a density of 1.25 g/L at 273.15 K and 1 atm has M = 1.25 × 0.082057 × 273.15 ÷ 1 = 28.02 g/mol, close to nitrogen's 28.014 g/mol. Carbon dioxide (44.009 g/mol) at 25 °C and 1 atm has a density of 1.799 g/L, which is why it sinks below air. ## When a gas isn't ideal The ideal gas law assumes gas particles take up no space and don't attract each other. That's close to true for most gases at everyday conditions, so answers are usually within a few percent. Real gases stray further from the law at high pressure, where the particles' own volume matters, and at low temperature, where attractions pull them together. Gases with strong intermolecular forces, like water vapor and ammonia, deviate the most. If a question asks which of two gases behaves more ideally, pick the one with weaker intermolecular forces and smaller particles, and expect any gas to behave more ideally at higher temperature and lower pressure. Gases are part of AP Chemistry Unit 3 (topics 3.4–3.6) and AP Physics 2 Unit 9. Review them with the [AP Chemistry Unit 3 cheat sheet](https://www.albert.io/blog/ap-chemistry-unit-3-cheat-sheet/), the [ideal gas law review for AP Chemistry](https://www.albert.io/blog/ideal-gas-law-ap-chemistry-review/) and the [gas laws review](https://www.albert.io/blog/gas-laws-chemistry-review/), and check where you stand with the [AP Chemistry score calculator](https://www.albert.io/blog/ap-chemistry-score-calculator/) or the [AP Physics 2 score calculator](https://www.albert.io/blog/ap-physics-2-score-calculator/). To find a molar mass on its own, use the [molar mass calculator](https://www.albert.io/blog/molar-mass-calculator/). Your inputs stay in your browser so they're there when you come back. Nothing is sent to Albert. ## FAQ ### What is the ideal gas law? PV = nRT. It links a gas's pressure (P), volume (V), amount in moles (n) and kelvin temperature (T) through the gas constant R = 0.082057 L·atm/(mol·K). If you know any three, you can find the fourth. ### Which value of R should I use? Match R to your units. With pressure in atm and volume in L, use 0.082057 L·atm/(mol·K). With pressure in kPa and volume in L, use 8.314 L·kPa/(mol·K), which is the same as 8.314 J/(mol·K). The calculator picks the right one for you. ### Why does temperature have to be in kelvins? The gas laws describe temperatures measured from absolute zero, where the Kelvin scale starts. On the Celsius scale, doubling 10 °C to 20 °C doesn't double the gas's energy, but doubling 283 K to 566 K does. Add 273.15 to a Celsius temperature to get kelvins. ### What volume does 1 mole of gas take up at STP? At 0 °C (273.15 K) and 1 atm, 1 mole of an ideal gas takes up 22.41 L. Some newer textbooks define STP as 1 bar instead of 1 atm, which gives 22.71 L. ### When should I use the combined gas law instead? Use the combined gas law, P₁V₁/T₁ = P₂V₂/T₂, when the same sample of gas changes from one set of conditions to another and the amount doesn't change. Use PV = nRT when you're working with one set of conditions or need the number of moles.