The density of a material at a given temperature is its reference density multiplied by a correction factor: ρ = ρ₀ / [1 + β(T − T₀)] for liquids and solids, or ρ = ρ₀ × (T₀ / T) for gases measured in kelvin. In practice you take a known density at a reference temperature, insert the material's coefficient of thermal expansion (or, for gases, just the two absolute temperatures), and compute the corrected value. The short version: liquids and solids expand only slightly, so β is tiny and the correction is small; gases expand in proportion to absolute temperature, so the correction is large. The work is mostly bookkeeping — get your units of temperature, expansion coefficient and density consistent and the formula does the rest.

What You'll Need

  • A reference density (ρ₀) for the material at a known temperature (T₀), usually taken from a table at 0 °C or 20 °C.
  • The volumetric coefficient of thermal expansion (β) for the material, in per kelvin or per degree Celsius. For gases you can skip this and use absolute temperature instead.
  • A calculator that handles division and powers, or a spreadsheet.
  • Consistent temperature units: degrees Celsius is fine for differences, but for gases you must convert to kelvin.
  • Optional: the material's density at several temperatures if you want to check your result against published data.

Step-by-Step

  1. Write down what you know. Note the reference density ρ₀, the reference temperature T₀ that goes with it, the target temperature T, and the expansion coefficient β if you have one. Keep the reference temperature attached to the density — a density without its temperature is incomplete information, because that is the whole point of the correction.
  2. Decide which formula applies. If the substance is a liquid or a solid, the material expands by a small fraction of its volume, so use ρ = ρ₀ / [1 + β(T − T₀)]. If it is a gas held at roughly constant pressure, its density is inversely proportional to absolute temperature, so use ρ = ρ₀ × (T₀ / T) with both temperatures in kelvin. Water below about 4 °C is a special case because it expands as it cools; the simple linear formula fails there, so use tabulated data instead.
  3. Convert temperatures where needed. For solids and liquids only the difference (T − T₀) enters, and a Celsius difference equals a kelvin difference, so no conversion is needed. For gases convert both temperatures: K = °C + 273.15. Mixing Celsius into a gas ratio is the single most common arithmetic error in this calculation.
  4. Compute the temperature change. Subtract the reference temperature from the target temperature. If the result is positive the material warmed and density will fall; if negative it cooled and density will rise. Keep the sign — dropping it flips the direction of the correction.
  5. Multiply by the expansion coefficient. For example, if β is 0.0007 per °C and the temperature rises by 30 °C, then β × ΔT = 0.021. Add 1 to get the volume-expansion factor, 1.021, which means the volume grew by about 2.1 percent.
  6. Divide the reference density by that factor. Continuing the example, a reference density of 1000 kg/m³ gives 1000 / 1.021 ≈ 979.4 kg/m³. The density fell by about 2 percent, matching the volume increase, because mass is conserved while volume grows.
  7. For a gas, take the ratio directly. A gas referenced at 293.15 K with density 1.2 kg/m³, heated to 373.15 K, gives 1.2 × (293.15 / 373.15) ≈ 0.943 kg/m³. Notice the correction is far larger than for a liquid, roughly 21 percent here.
  8. Check the result for plausibility. Liquids and solids typically change density by a fraction of a percent to a few percent over modest temperature ranges; gases change by tens of percent. If your answer moves in the opposite direction to the temperature change, or by orders of magnitude more than expected, re-check the sign and the units before trusting it.
  9. Repeat across a temperature range if needed. The linear form assumes β is roughly constant over the range. For wide ranges, tabulate the calculation at intervals using a β value appropriate to each interval, or use a published density table, which already accounts for nonlinear behaviour.

Common Mistakes

  • Using Celsius in the gas formula. The ratio T₀ / T only works in kelvin. In Celsius, 20 °C to 100 °C looks like a 5× ratio when the true absolute ratio is 293 / 373 ≈ 0.79. This produces wildly wrong densities.
  • Confusing linear and volumetric expansion. Many tables list the linear coefficient α. The volumetric coefficient is roughly 3α for isotropic solids. Mixing them understates the correction by a factor of three.
  • Forgetting that the reference density has a temperature. If ρ₀ was measured at 15 °C and you treat it as room temperature, the correction is applied to the wrong baseline and the error compounds.
  • Applying the liquid formula to a gas. Gas density varies as 1/T, not as 1/(1 + βΔT). Using an expansion coefficient for a gas gives a result that is far too small.
  • Dropping the negative sign. Subtracting T from T₀ instead of the other way round quietly inverts the answer. Always sanity-check which way the density should move.
  • Ignoring phase changes and anomalies. Water near freezing and materials near a phase transition do not follow a simple linear expansion; tabulated data must replace the formula there.

Tips

  • Work in SI units throughout — kg/m³ and kelvin — to avoid conversion slips. Convert to other units only at the end.
  • Remember the physical principle: mass does not change, so density falls exactly in proportion to the increase in volume. If you know the volume change, you can cross-check the density answer.
  • For small temperature changes, the approximation ρ ≈ ρ₀ × [1 − β(T − T₀)] is close enough and easier to do in your head. It diverges from the exact form only when βΔT becomes large.
  • Keep a small reference table of β values for the common materials you work with, and note the temperature range over which each was measured.
  • If precision matters, use a published density-temperature table for your specific grade or grade of material rather than a single generic coefficient; composition, concentration (for solutions) and pressure all shift the curve.

Troubleshooting

If that did not work: start with the simplest checks. Confirm that the reference density and the expansion coefficient belong to the same material and the same phase — a coefficient for liquid water applied to ice gives nonsense. Recompute the temperature difference with explicit signs. If your answer is implausible, test with a known case: a gas heated from 20 °C to 40 °C should show a density drop of roughly 6 to 7 percent when worked in kelvin; if you get much more or much less, your units are off.

If the result looks right for one temperature but drifts at extremes, the linear assumption is likely the problem — switch to tabulated data. If a published density disagrees with yours, check whether the table quotes density at a different reference temperature, whether the substance is a solution whose concentration changed, or whether pressure was held constant. For gases especially, confirm that pressure is unchanged, because the ideal-gas relationship assumes isobaric conditions; at different pressures the density formula needs the pressure ratio as well. Finally, if you are working from a material specification, the safest check is against the maker's own data sheet, which states the conditions under which its numbers were measured.

Frequently Asked Questions

What is the formula for density as a function of temperature?

For liquids and solids, ρ = ρ₀ / [1 + β(T − T₀)], where β is the volumetric expansion coefficient. For gases at constant pressure, ρ = ρ₀ × (T₀ / T) with temperatures in kelvin.

Why does density decrease as temperature increases?

Heating makes most materials expand, so the same mass occupies more volume. Since density is mass divided by volume, it falls. The exception is water between 0 °C and about 4 °C, which contracts slightly as it warms.

Do I use the linear or volumetric expansion coefficient?

Use the volumetric one, which is about three times the linear coefficient for an isotropic solid. Using the linear value understates the density change.

Can I use this formula for gases?

Only in its gas form, ρ = ρ₀(T₀/T), and only when pressure is roughly constant. Gases expand far more per degree than liquids, and the Celsius-to-kelvin conversion is essential.

How accurate is the linear formula?

It is accurate for modest temperature changes where β stays roughly constant. Over wide ranges or near phase changes, the coefficient varies, and tabulated density data is more reliable.

Does pressure matter?

For liquids and solids the effect is usually small and the formula ignores it. For gases, pressure changes alter density directly, so the simple temperature formula assumes constant pressure.