Skip to main content
Physics LibreTexts

13.3: The Ideal Gas Law

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Learning Objectives

    By the end of this section, you will be able to:

    • State the ideal gas law in terms of molecules and in terms of moles.
    • Use the ideal gas law to calculate pressure change, temperature change, volume change, or the number of molecules or moles in a given volume.
    • Use Avogadro’s number to convert between number of molecules and number of moles.

    In this section, we continue to explore the thermal behavior of gases. In particular, we examine the characteristics of atoms and molecules that compose gases. (Most gases, for example nitrogen, \(N_2\) and oxygen, \(O_2\) are composed of two or more atoms. We will primarily use the term “molecule” in discussing a gas because the term can also be applied to monatomic gases, such as helium.)

    Figure \(\PageIndex{1}\): The air inside these hot air balloons flying over Albuquerque, New Mexico is hotter (and thus less dense) than the ambient air. As a result, the balloons experience a buoyant force pushing them upward. (CC BY 2.0; Danae Hurst).

    Gases are easily compressed. We can see evidence of this elsewhere, where you will note that gases have the largest coefficients of volume expansion. The large coefficients mean that gases expand and contract very rapidly with temperature changes. In addition, you will note that most gases expand at the same rate, or have the same \( \beta\). This raises the question as to why gases should all act in nearly the same way, when liquids and solids have widely varying expansion rates.

    The answer lies in the large separation of atoms and molecules in gases, compared to their sizes, as illustrated in Figure \(\PageIndex{1}\). Because atoms and molecules have large separations, forces between them can be ignored, except when they collide with each other during collisions. The motion of atoms and molecules (at temperatures well above the boiling temperature) is fast, such that the gas occupies all of the accessible volume and the expansion of gases is rapid. In contrast, in liquids and solids, atoms and molecules are closer together and are quite sensitive to the forces between them.

    Spheres representing atoms and molecules; the spheres are relatively far apart and are distributed randomly.
    Figure \(\PageIndex{2}\): Atoms and molecules in a gas are typically widely separated, as shown. Because the forces between them are quite weak at these distances, the properties of a gas depend more on the number of atoms per unit volume and on temperature than on the type of atom.

    To get some idea of how pressure, temperature, and volume of a gas are related to one another, consider what happens when you pump air into an initially deflated tire. The tire’s volume first increases in direct proportion to the amount of air injected, without much increase in the tire pressure. Once the tire has expanded to nearly its full size, the walls limit volume expansion. If we continue to pump air into it, the pressure increases. The pressure will further increase when the car is driven and the tires move. Most manufacturers specify optimal tire pressure for cold tires (Figure \(\PageIndex{2}\)).

    The figure has three parts, each part showing a pair of tires, and each tire connected to a pressure gauge. Each pair of tires represents the before and after images of a single tire, along with a change in pressure in that tire. In part a, the tire pressure is initially zero. After some air is added, represented by an arrow labeled Add air, the pressure rises to slightly above zero. In part b, the tire pressure is initially at the half-way mark. After some air is added, represented by an arrow labeled Add air, the pressure rises to the three-fourths mark. In part c, the tire pressure is initially at the three-fourths mark. After the temperature is raised, represented by an arrow labeled Increase temperature, the pressure rises to nearly the full mark.
    Figure \(\PageIndex{3}\): (a) When air is pumped into a deflated tire, its volume first increases without much increase in pressure. (b) When the tire is filled to a certain point, the tire walls resist further expansion and the pressure increases with more air. (c) Once the tire is inflated, its pressure increases with temperature.

    At room temperatures, collisions between atoms and molecules can be ignored. In this case, the gas is called an ideal gas, in which case the relationship between the pressure, volume, and temperature is given by the equation of state called the ideal gas law.

    Definition: Ideal Gas Law

    The ideal gas law states that

    \[PV = NkT, \label{igl}\]

    where \(P\) is the absolute pressure of a gas, \(V\) is the volume it occupies, \(N\) is the number of atoms and molecules in the gas, and and \(T\) is its absolute temperature. The constant \(k\) is called the Boltzmann constant discussed below.

    Definition: Boltzmann constant

    The Boltzmann constant \(k\) is named in honor of Austrian physicist Ludwig Boltzmann (1844–1906) and has the value

    \[k = 1.38 \times 10^{-23} \, J/K.\]

    The ideal gas law can be derived from basic principles, but was originally deduced from experimental measurements of Charles’ law (that volume occupied by a gas is proportional to temperature at a fixed pressure) and from Boyle’s law (that for a fixed temperature, the product \(PV\) is a constant). In the ideal gas model, the volume occupied by its atoms and molecules is a negligible fraction of \(V\). The ideal gas law describes the behavior of real gases under most conditions. (Note, for example, that \(N\) is the total number of atoms and molecules, independent of the type of gas.)

    Let us see how the ideal gas law is consistent with the behavior of filling the tire when it is pumped slowly and the temperature is constant. At first, the pressure \(P\) is essentially equal to atmospheric pressure, and the volume \(V\) increases in direct proportion to the number of atoms and molecules \(N\) put into the tire. Once the volume of the tire is constant, Equation \ref{igl} predicts that the pressure should increase in proportion to the number N of atoms and molecules.

    Example \(\PageIndex{1}\): Calculating Pressure Changes Due to Temperature Changes - Tire Pressure

    Suppose your bicycle tire is fully inflated, with an absolute pressure of \(7.00 \times 10^5 \, Pa\) (a gauge pressure of just under \(90.0 \, lb/in^2\)) at a temperature of \(18.0^oC\). What is the pressure after its temperature has risen to \(35.0^oC\)? Assume that there are no appreciable leaks or changes in volume.


    The pressure in the tire is changing only because of changes in temperature. First we need to identify what we know and what we want to know, and then identify an equation to solve for the unknown.

    We know the initial pressure \(P_0 = 7.00 \times 10^5 \, Pa\), the initial temperature \(T_0 = 18.0^oC\), and the final temperature \(T_F = 35.0^oC\). We must find the final pressure \(P_f\). How can we use Equation \ref{igl}? At first, it may seem that not enough information is given, because the volume \(V\) and number of atoms \(N\) are not specified. What we can do is use the equation twice:

    \[P_0V_0 = NkT_0 \nonumber\]


    \[P_fV_f = NkT_f \nonumber.\]

    If we divide \(P_fV_f\) by \(P_0V_0\), we can come up with an equation that allows us to solve for \(P_f\)

    \[\dfrac{P_fV_f}{P_0V_0} = \dfrac{N_fkT_f}{N_0kT_0} \nonumber\]

    Since the volume is constant, \(V_f\) and \(V_0\) are the same and they cancel out. The same is true for \(N_f\) and \(N_0\), and \(k\), which is a constant. Therefore,

    \[\dfrac{P_f}{P_0} = \dfrac{T_f}{T_0}. \nonumber\]

    We can then rearrange this to solve for \(P_f\):

    \[P_f = P_0\dfrac{T_f}{T_0},\label{ex1a}\]

    where the temperature must be in units of kelvins, because \(T_0\) and \(T_f\) are absolute temperatures.


    1. Convert temperatures from Celsius to Kelvin.

    \[T_0 = (18.0 +273)K = 291 \, K \nonumber\]

    \[T_f = (35.0 + 273)K = 308 \, K \nonumber\]

    2. Substitute the known values into Equation \ref{ex1a}.

    \[\begin{align*} P_f &= P_0\dfrac{T_f}{T_0} \\[5pt] &= 7.00 \times 10^5 \, Pa \left(\dfrac{308 \, K)}{291 \, K}\right) \\[5pt] &= 7.41 \times 10^5 \, Pa \end{align*} \]


    The final temperature is about 6% greater than the original temperature, so the final pressure is about 6% greater as well. Note that absolute pressure and absolute temperature must be used in the ideal gas law.

    Take-Home Experiment - Refrigerating a Balloon

    The Inflate a balloon at room temperature. Leave the inflated balloon in the refrigerator overnight. What happens to the balloon, and why?

    We left a balloon in a the freezer for a bit then I pulled it out to see what would happen

    How many molecules are in a typical object, such as gas in a tire or water in a drink? We can use the ideal gas law (Equation \ref{igl}) to give us an idea of how large \(N\) typically is.

    Example \(\PageIndex{2}\): Calculating the Number of Molecules in a Cubic Meter of Gas

    Calculate the number of molecules in a cubic meter of gas at standard temperature and pressure (STP), which is defined to be \(0^oC\) and atmospheric pressure.


    Because pressure, volume, and temperature are all specified, we can use the ideal gas law (Equation \ref{igl}) to find \(N\).


    1. Identify the knowns.

    • \(T = 0^oC = 273 \, K\)
    • \(P = 1.01 \times 10^5 \, Pa\)
    • \(V = 1.00 \, m^3\)
    • \(k = 1.38 \times 10^{-23} \, J/K\)

    2. Identify the unknown: number of molecules, \(N\).

    3. Rearrange the ideal gas law to solve for \(N\).

    \[\begin{align*} N &= \dfrac{PV}{kT} \\[5pt] &= \dfrac{(1.01 \times 10^5\, Pa)(1.00 \, m^3)}{(1.38 \times 10^{-23} \, J/K)(273 \, K)} \\[5pt] &= 2.68 \times 10^{25} \, molecules \end{align*}\]


    This number is undeniably large, considering that a gas is mostly empty space. \(N\) is huge, even in small volumes. For example, \(1\, cm^3\) of a gas at STP has \(2.68 \times 10^{10}\) molecules in it. Once again, note that \(N\) is the same for all types or mixtures of gases.

    Moles and Avogadro’s Number

    It is sometimes convenient to work with a unit other than molecules when measuring the amount of substance. A mole (abbreviated mol) is defined to be the amount of a substance that contains as many atoms or molecules as there are atoms in exactly 12 grams (0.012 kg) of carbon-12. The actual number of atoms or molecules in one mole is called Avogadro’s number \((N_A)\), in recognition of Italian scientist Amedeo Avogadro (1776–1856). He developed the concept of the mole, based on the hypothesis that equal volumes of gas, at the same pressure and temperature, contain equal numbers of molecules. That is, the number is independent of the type of gas. This hypothesis has been confirmed with an estimate of the value of Avogadro’s number.

    Definition: Avogadro’s Number

    One mole always contains \(6.02 \times 10^{23}\) particles (atoms or molecules), independent of the element or substance. A mole of any substance has a mass in grams equal to its molecular mass, which can be calculated from the atomic masses given in the periodic table of elements.

    \[N_A = 6.02 \times 10^{23} \, mol^{-1}\]

    The illustration shows relatively flat land with a solitary mountain, labeled Mt. Everest, and blue sky above. A double-headed vertical arrow stretches between the land and a point in the sky that is well above the peak of the mountain. The arrow, labeled table tennis balls, serves to indicate that a column of one mole of table tennis balls would reach a point in the sky that is much higher than the peak of Mt. Everest.
    Figure \(\PageIndex{4}\): How big is a mole? On a macroscopic level, one mole of table tennis balls would cover the Earth to a depth of about 40 km.

    Exercise \(\PageIndex{2}\)

    • The active ingredient in a Tylenol pill is 325 mg of acetaminophen \((C_8H_9NO_2)\). Find the number of active molecules of acetaminophen in a single pill.

    We first need to calculate the molar mass (the mass of one mole) of acetaminophen. To do this, we need to multiply the number of atoms of each element by the element’s atomic mass.

    (8 moles of Carbon)(12 grams/mole) + (9 moles hydrogen)(1 gram/mole) + (1 mole of nitrogen)(14 grams/mole) + (2 moles oxygen)(16 grams/mole) = 151 grams.

    Then we need to calculate the number of moles in 325 mg.

    \[ \left ( \frac{325 \, mg}{151 \, grams/mole} \right) \left( \frac{1 \, gram}{1000 \, mg}\right) = 2.15 \times 10^{-3} \, moles \nonumber\]

    Then use Avogadro’s number to calculate the number of molecules.

    \[N = (2.15 \times 10^{-3} \, moles)(6.02 \times 10^{23} \, molecules/mole)\]\[ = 1.30 \times 10^{21} \, molecules \nonumber\]

    Example \(\PageIndex{3}\): Calculating Moles per Cubic Meter and Liters per Mole


    1. the number of moles in \(1.00 \, m^3\) of gas at STP, and
    2. the number of liters of gas per mole.

    Strategy and Solution

    (a) We are asked to find the number of moles per cubic meter, and we know from Example that the number of molecules per cubic meter at STP is \(2.68 \times 10^{25}\). The number of moles can be found by dividing the number of molecules by Avogadro’s number. We let \(n\) stand for the number of moles,

    \[n \, mole/m^3 = \dfrac{N \, molecules/m^3}{6.02 \times 10^{23} \, molecules/mol} = \dfrac{2.68 \times 10^{25} \, molecules/m^3}{6.02 \times 10^{23} \, molecules/mol} = 44.5 \, mol/m^3\]

    (b) Using the value obtained for the number of moles in a cubic meter, and converting cubic meters to liters, we obtain

    \[\dfrac{(10^3 \, L/m^3)}{44.5 \, mol/m^3} = 22.5 \, L/mol.\]


    This value is very close to the accepted value of 22.4 L/mol. The slight difference is due to rounding errors caused by using three-digit input. Again this number is the same for all gases. In other words, it is independent of the gas.

    The (average) molar weight of air (approximately 80% \(N_2\) and 20% \(O_2\) is \(M = 28.8 \, g\). Thus the mass of one cubic meter of air is 1.28 kg. If a living room has dimensions \(5 \, m \times 5 \, m \times 3 \, m\), the mass of air inside the room is 96 kg, which is the typical mass of a human.

    Exercise \(\PageIndex{3}\)

    The density of air at standard conditions \((P = 1 \, atm\) and \(T = 20^oC)\) is \(1.28 \, kg/m^3\). At what pressure is the density \(0.64 \, kg/m^3\) if the temperature and number of molecules are kept constant?


    The best way to approach this question is to think about what is happening. If the density drops to half its original value and no molecules are lost, then the volume must double. If we look at the equation \(PV = NkT\), we see that when the temperature is constant, the pressure is inversely proportional to volume. Therefore, if the volume doubles, the pressure must drop to half its original value, and \(P_f = 0.50 \, atm\).

    The Ideal Gas Law Restated Using Moles

    A very common expression of the ideal gas law uses the number of moles, \(n\), rather than the number of atoms and molecules (\(N\)). We start from the ideal gas law, \[PV = NkT,\] and multiply and divide the equation by Avogadro’s number \(N_A\). This gives

    \[PV = \dfrac{N}{N_A}N_AkT.\]

    Note that \(n = N/N_A\) is the number of moles. We define the universal gas constant \(R = N_Ak\), and obtain the ideal gas law in terms of moles.

    Definition: Ideal Gas Law (in terms of moles)

    The ideal gas law (in terms of moles) is

    \[PV = nRT. \label{iglmoles}\]

    where \(P\) is the absolute pressure of a gas, \(V\) is the volume it occupies, \(n\) is the number of moles of atoms and molecules in the gas, and and \(T\) is its absolute temperature. The constant \(R\) is called the gas constant and varies depending on the units of the pressure and volume used.

    Definition: Gas Constant

    The numerical value of \(R\) in SI units is

    \[ \begin{align*} R &= N_Ak \\[5pt] &= (6.02 \times 10^{23} \, mol^{-1}) (1.38 \times 10^{-23} \, J/K) \\[5pt] &= 8.31 \, J/mol \cdot K. \end{align*}\]

    In other units,

    • \(R = 1.99 \, cal/mol \cdot K\)
    • \(R = 0.0821 \, L \cdot atm/mol \cdot K\)

    You can use whichever value of \(R\) is most convenient for a particular problem.

    Example \(\PageIndex{4}\): Calculating Number of Moles - Gas in a Bike Tire

    How many moles of gas are in a bike tire with a volume of \(2.00 \times 10^{-3} \,m^3(2.00 \, L)\), a pressure of \(7.00 \times 10^5 \, Pa\) (a gauge pressure of just under \(90.0 \, lb/in^2\)), and at a temperature of \(18.0^oC\)?


    Identify the knowns and unknowns, and choose an equation to solve for the unknown. In this case, we solve the ideal gas law (Equation \ref{iglmoles}) for the number of moles \(n\).


    1. Identify the knowns.

    • \(P = 7.00 \times 10^5 \, Pa\)
    • \(V = 2.00 \times 10^{-3} m^3\)
    • \(T = 18.0^oC = 291 \, K\)
    • \(R = 8.31 \, J/mol \cdot K\)

    2. Rearrange Equation \ref{iglmoles} to solve for \(n\) and substitute known values.

    \[\begin{align*} n &= \dfrac{PV}{RT} \\[5pt] &= \dfrac{(7.00 \times 10^5 Pa)(2.00 \times 10^{-3} m^3)}{(8.31 \, J/mol\cdot K)(291 \, K)} \\[5pt] &= 0.579 \, mol \end{align*}\]


    The most convenient choice for \(R\) in this case is \(8.31 \, J/mol \cdot K\), because our known quantities are in SI units. The pressure and temperature are obtained from the initial conditions in Example \(\PageIndex{1}\), but we would get the same answer if we used the final values.

    The ideal gas law can be considered to be another manifestation of the Law of Conservation of Energy. Work done on a gas results in an increase in its energy, increasing pressure and/or temperature, or decreasing volume. This increased energy can also be viewed as increased internal kinetic energy, given the gas’s atoms and molecules.

    The Ideal Gas Law and Energy

    Let us now examine the role of energy in the behavior of gases. When you inflate a bike tire by hand, you do work by repeatedly exerting a force through a distance. This energy goes into increasing the pressure of air inside the tire and increasing the temperature of the pump and the air.

    The ideal gas law is closely related to energy: the units on both sides are joules. The right-hand side of the ideal gas law in \(PV = NkT\) is \(NkT\). This term is roughly the amount of translational kinetic energy of \(N\) atoms or molecules at an absolute temperature \(T\), as we shall see formally in Kinetic Theory: Atomic and Molecular Explanation of Pressure and Temperature. The left-hand side of the ideal gas law is \(PV\) which also has the units of joules. We know from our study of fluids that pressure is one type of potential energy per unit volume, so pressure multiplied by volume is energy. The important point is that there is energy in a gas related to both its pressure and its volume. The energy can be changed when the gas is doing work as it expands—something we explore in Heat and Heat Transfer Methods—similar to what occurs in gasoline or steam engines and turbines.

    Problem-Solving Strategy: The Ideal Gas Law

    • Step 1 Examine the situation to determine that an ideal gas is involved. Most gases are nearly ideal.
    • Step 2 Make a list of what quantities are given, or can be inferred from the problem as stated (identify the known quantities). Convert known values into proper SI units (K for temperature, Pa for pressure, \(m^3\) for volume, molecules for \(N\), and moles for \(n\).
    • Step 3 Identify exactly what needs to be determined in the problem (identify the unknown quantities). A written list is useful.
    • Step 4 Determine whether the number of molecules or the number of moles is known, in order to decide which form of the ideal gas law to use. The first form is \(PV = NkT\) and involves \(N\), the number of atoms or molecules. The second form is \(PV = nRT\) and involves \(n\), the number of moles.
    • Step 5 Solve the ideal gas law for the quantity to be determined (the unknown quantity). You may need to take a ratio of final states to initial states to eliminate the unknown quantities that are kept fixed.
    • Step 6 Substitute the known quantities, along with their units, into the appropriate equation, and obtain numerical solutions complete with units. Be certain to use absolute temperature and absolute pressure.
    • Step 7 Check the answer to see if it is reasonable: Does it make sense?

    Exercise \(\PageIndex{4}\)

    Liquids and solids have densities about 1000 times greater than gases. Explain how this implies that the distances between atoms and molecules in gases are about 10 times greater than the size of their atoms and molecules.


    Atoms and molecules are close together in solids and liquids. In gases they are separated by empty space. Thus gases have lower densities than liquids and solids. Density is mass per unit volume, and volume is related to the size of a body (such as a sphere) cubed. So if the distance between atoms and molecules increases by a factor of 10, then the volume occupied increases by a factor of 1000, and the density decreases by a factor of 1000.


    • The ideal gas law relates the pressure and volume of a gas to the number of gas molecules and the temperature of the gas.
    • The ideal gas law can be written in terms of the number of molecules of gas: \[PV = NkT,\] where \(P\) is pressure, \(V\) is volume, \(T\) is temperature, \(N\) is number of molecules, and \(k\) is the Boltzmann constant \[ k = 1.38 \times 10^{-23} J/K.\]
    • A mole is the number of atomes in a 12-g sample of carbon-12.
    • The number of molecules in a mole is called Avogadro’s number \(N_A\), \[N_A = 6.02 \times 10^{-23} mol^{-1}.\]
    • A mole of any substance has a mass in grams equal to its molecular weight, which can be determined from the periodic table of elements.
    • The ideal gas law can also be written and solved in terms of the number of moles of gas: \[PV = nRT,\] where \(n\) is number of moles and \(R\) is the universal gas constant, \[R = 8.31 \, J/mol\cdot K.\]
    • The ideal gas law is generally valid at temperatures well above the boiling temperature.


    ideal gas law
    the physical law that relates the pressure and volume of a gas to the number of gas molecules or number of moles of gas and the temperature of the gas
    Boltzmann constant
    \(k\), a physical constant that relates energy to temperature; \(k=1.38×10^{–23}J/K\)
    Avogadro’s number
    \(N_A\), the number of molecules or atoms in one mole of a substance; \(N_A=6.02×10^{23}\) particles/mole
    the quantity of a substance whose mass (in grams) is equal to its molecular mass

    This page titled 13.3: The Ideal Gas Law is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by OpenStax via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.