What Is the Relationship Between Temperature and Density

For most substances, density decreases as temperature rises—provided the substance can expand and its mass stays constant. Density is mass divided by volume, so expansion increases volume and lowers density. Cooling usually has the opposite effect.
The relationship depends on the substance and its conditions. Gases are especially sensitive to temperature, while many solids and liquids expand less. Water is an important exception near its freezing point: it is densest at about 4 °C, and ice is less dense than liquid water.
How temperature changes density
Heating gives particles more energy. In many substances, this causes them to move or vibrate more and the material to expand. If mass remains constant, the greater volume means lower density.
The amount of expansion varies by substance. Gases typically show larger density changes than solids or liquids over comparable temperature changes. This general pattern is explained by thermal expansion (Hyperphysics: Thermal Expansion).
The material must be able to expand for its volume to increase. In a rigid container holding a fixed amount of substance, volume and mass stay constant, so density does not change as temperature rises. Pressure may change instead.
For gases, pressure is also important. At constant pressure, warming a gas generally lowers its density. In a rigid, sealed container, warming raises the pressure while the gas’s density remains constant. Gas calculations use absolute temperature, measured in kelvin.
Water near its freezing point
Water’s density changes unusually between 0 °C and about 4 °C. As liquid water cools toward 4 °C, it becomes denser. Below about 4 °C, further cooling makes it less dense. When water freezes, the resulting ice is less dense than liquid water, which is why ice floats (USGS: Water Density and Temperature).
Above about 4 °C, warmer water is generally less dense than cooler water. For precise comparisons, use density data for the relevant temperature.
Example: Gas in different containers
Consider the same gas in two settings. In a rigid, sealed container, its mass and volume stay fixed as it warms, so its density remains constant while its pressure rises.
In a flexible container that can expand, the gas can occupy more volume as it warms. If its mass stays constant, its density falls. The difference is whether the container allows the gas to expand.
Applying the relationship
When comparing the same substance at different temperatures, check whether its volume can change and whether pressure is held constant. These conditions matter especially for gases. For solids and liquids, thermal expansion usually indicates the direction of the density change, but precise calculations may require measured data.
When comparing different substances, consider their composition and physical state as well as temperature. For a fair comparison, use density values measured under the same conditions.
A thermal expansion coefficient can help estimate how much a solid or liquid changes volume over a small temperature range. If the coefficient is positive, the substance tends to expand as it warms, so its density tends to fall when mass stays constant. Because the coefficient can vary with temperature, estimates are less reliable over wider ranges. For accurate values, consult reference data such as the NIST Chemistry WebBook and check the listed temperature and pressure.
Key Takeaways
- For most substances, density decreases as temperature rises when the substance can expand and its mass stays constant.
- Gas density depends on both temperature and pressure; gases often show larger density changes than solids and liquids.
- Water is densest at about 4 °C, and ice is less dense than liquid water (USGS: Water Density and Temperature).
- In a rigid container with fixed mass and volume, density stays constant as temperature changes, while pressure may change.
- Use density data for the relevant temperature and pressure when accuracy matters (NIST Chemistry WebBook).