Safeguard
Supply Chain Security•

Newton's Law of Cooling Explained: Coffee, Food Safety, Time of Death

Newton's law of cooling says an object cools at a rate set by its gap from the surroundings. Worked examples: coffee, cooling food and time since death.

Safeguard Security Team
45 min read

Newton's law of cooling says that the rate at which an object's temperature changes is proportional to the difference between its temperature and the temperature around it. Solve it and the gap to ambient shrinks exponentially, with a fixed time constant and a fixed half life. It predicts how fast coffee cools, guides food safety cooling, and is the starting point (not the end point) for forensic estimates of time since death.

This post works through the law one level deeper than our laws of thermodynamics explainer and sits beside the Stefan-Boltzmann law post, which covers the radiation side of heat transfer. Every number below comes with its units, and every worked example can be reproduced with a pocket calculator or the short Python script near the end.

Key takeaways

  • The law is dT/dt = -k (T - T_a): the cooling rate depends on the temperature difference, not the temperature itself.
  • The solution is T(t) = T_a + (T_0 - T_a) e^(-k t). The difference to ambient falls by the same fraction in every equal time step.
  • The time constant is τ = 1/k; the half life of the temperature difference is ln 2 / k, about 0.693/k.
  • For a well mixed object cooled by convection, k = hA/(mc).
  • Coffee that drops from 90 °C to 80 °C in 5 minutes in a 20 °C room reaches 60 °C after about 18 minutes.
  • Forensic practice does not use plain Newtonian cooling for time since death. The published method uses a two exponential model with an early plateau, body weight and correction factors, and reports a range.
  • The FDA Food Code 2026 requires cooked time and temperature controlled food to cool from 57 °C to 21 °C within 2 hours and to 5 °C or less within 6 hours in total.
  • The law fails when radiation dominates, when the object changes phase, when its inside is not at one temperature, and when the surroundings change.

What does Newton's law of cooling say?

In words: the hotter something is compared with its surroundings, the faster it loses heat, and the rate of temperature change is directly proportional to that excess. Double the temperature difference and you double the rate of cooling. The law applies just as well to warming. A cold drink taken out of a refrigerator warms toward room temperature along the same kind of curve, only with the sign of the difference reversed.

The law sits on top of the zeroth law of thermodynamics. NASA Glenn Research Center's beginner guide to thermodynamics describes how two objects at different temperatures, brought into contact, exchange heat until they reach thermal equilibrium, with heat always flowing from the hotter object to the colder one. Newton's law of cooling adds a rate to that picture: it says how quickly equilibrium is approached, at least for the common case of an object losing heat to a fluid such as air or water.

The equation, term by term

The differential form is:

dT/dt = -k (T - T_a)
SymbolMeaningTypical unit
Ttemperature of the object at time t°C or K
T_aambient temperature of the surroundings, assumed constant°C or K
T - T_aexcess temperature, the driving differenceK (or °C, which is the same size)
dT/dtrate of change of the object's temperatureK per minute, K per second
kcooling constant, a property of the object and its situationper minute, per second, per hour
τ = 1/ktime constantminutes, seconds, hours

The minus sign says the temperature moves toward ambient. If T is above T_a, the right hand side is negative and the object cools. If T is below T_a, the right hand side is positive and the object warms.

The cooling constant k is not a universal number. It changes with the size and shape of the object, what it is made of, whether it has a lid, whether air is moving past it, and what it is sitting on. A cup of coffee on a desk has one k; the same cup in front of a fan has a larger one.

Why Celsius differences and kelvin differences are interchangeable

Only differences of temperature appear in the law. The BIPM SI Brochure defines the kelvin as the SI unit of thermodynamic temperature and the degree Celsius as a unit equal in magnitude to the kelvin, with Celsius temperature equal to thermodynamic temperature minus 273.15 K. NIST's guide to the SI makes the same point: a difference of 1 °C is exactly a difference of 1 K.

So you may use °C as long as T and T_a use the same scale; never mix a mug at 363.15 K with a room at 20 °C. Fahrenheit also works, because the solution only uses the ratio of two differences, and that ratio is the same in every scale. The value of k does not change. The radiation law is different: it uses the fourth power of absolute temperature, so it needs kelvin.

What Newton published in 1701

The law takes its name from a short paper titled "Scala graduum caloris" (a scale of the degrees of heat), printed in the Philosophical Transactions of the Royal Society of London, volume 22, issue 270, pages 824 to 829. The Crossref record for the paper dates the issue to 30 April 1701 and lists no author, which matches the usual account that the paper appeared anonymously and is attributed to Isaac Newton.

The paper was mainly about measuring temperature. It sets out a scale of heat with the heat of the human body as 12 parts, read from the expansion of linseed oil in a thermometer. To reach temperatures far beyond any liquid thermometer, the Latin text describes heating a thick piece of iron until it glowed, placing it in a cold spot where the wind blew steadily, and timing how long small pieces of different metals and other fusible materials laid on it took to solidify, until the iron had cooled to body heat. The paper explains why the iron sat in a uniform wind rather than still air: so that the air warmed by the iron was carried away and replaced by cold air at a steady rate, making the heat carried off in equal times proportional to the iron's heat. Under that assumption, the excess temperature falls in a geometric progression over equal time steps, which is exactly the exponential law in this post.

The modern form, with k = hA/(mc) and a heat transfer coefficient, came much later, after heat was understood as energy rather than as a fluid. The 1701 paper is the origin of the idea, not of the full engineering model. Note also that Newton chose forced airflow, the regime where the law works best.

Where the law comes from: the lumped capacitance model

Newton's law of cooling can be derived from two simpler statements. MIT's Unified Engineering notes on transient heat transfer walk through it.

First, the rate of heat loss from the surface to a fluid is Q_dot = h A (T - T_a), where h is the convective heat transfer coefficient in W/(m²·K) and A is the surface area in m². This is the definition of h, and engineers sometimes call that convection relation itself "Newton's law of cooling".

Second, energy balance. If the object has a uniform temperature, its stored heat changes as m c dT/dt, where m is mass in kg and c is specific heat capacity in J/(kg·K). For a solid the MIT notes write this as ρ V c dT/dt, with density ρ and volume V.

Setting heat lost equal to the drop in stored heat gives:

m c dT/dt = -h A (T - T_a)
dT/dt     = -(h A / (m c)) (T - T_a)
k         = h A / (m c)

That formula tells you what controls k. More surface area (shallow pans, heat sink fins) and a larger h (moving air, stirring, liquid baths) mean faster cooling. More mass and a larger specific heat (water stores a lot of heat per kelvin) mean slower cooling.

The model assumes the whole object has one temperature at any instant. The MIT notes give the test for that: the Biot number, Bi = hL/k_solid, where L is a characteristic length (for example half the thickness) and k_solid is the thermal conductivity of the object. When the Biot number is small, the temperature difference inside the object is small compared with the difference between its surface and the fluid, and the "lump" picture is fair. A metal spoon in air easily qualifies. A large pot of chili, or a human body, does not, and that is the key to two of our worked examples.

How do you solve Newton's law of cooling?

Separation of variables

Write θ = T - T_a for the excess temperature. Because T_a is constant, dθ/dt = dT/dt, and the law becomes:

dθ/dt = -k θ
dθ/θ  = -k dt
ln θ  = -k t + constant
θ(t)  = θ_0 e^(-k t)
T(t)  = T_a + (T_0 - T_a) e^(-k t)

This is the same first order linear equation that describes radioactive decay, the discharge of a capacitor through a resistor, and drug elimination in simple pharmacokinetic models. MIT OpenCourseWare's 18.03SC differential equations course treats it as one of the first examples of a first order linear equation, and the techniques there (integrating factors, exponential response) also handle the case where the ambient temperature changes with time.

To solve for time instead of temperature, take logs:

t = (1/k) ln( (T_0 - T_a) / (T - T_a) )

And to find k from two readings taken a time Δt apart:

k = (1/Δt) ln( (T_1 - T_a) / (T_2 - T_a) )

Time constant and half life of the temperature difference

Two quantities make the exponential easy to think about.

The time constant τ = 1/k is the time for the excess temperature to fall to 1/e, about 36.8 percent, of its starting value. After one time constant the object has covered 63.2 percent of the way to ambient.

The half life t_half = ln 2 / k, about 0.693 τ, is the time for the excess temperature to halve. The useful property is that it is the same at every stage. Coffee 70 K above room temperature drops to 35 K above it in one half life, and from 35 K to 17.5 K in the next.

Elapsed timeFraction of the starting difference leftFraction of the way to ambient
1 τ36.8 %63.2 %
2 τ13.5 %86.5 %
3 τ5.0 %95.0 %
5 τ0.7 %99.3 %
1 half life (0.693 τ)50 %50 %
2 half lives25 %75 %

Strictly, an exponential never reaches ambient; engineers usually treat about five time constants as settled.

How to find k from measurements

You can get k in three ways, in increasing order of reliability:

  1. One reading after the start. Measure T_0, wait, measure T_1, and use the two point formula. Quick, but any error in either reading goes straight into k.
  2. A cooling curve. Take several readings and fit a straight line to ln(T - T_a) against time. The slope is -k. Errors average out and you can see whether the data really fall on a straight line.
  3. Physical parameters. Compute k = hA/(mc) from estimates. Useful at design time, but h is often uncertain by tens of percent.

A plot of ln(T - T_a) against time also tests the law: a straight line means the exponential fits; a curve points to radiation, evaporation, an internal gradient or a drifting ambient.

Conduction, convection and radiation: which law governs which

Newton's law of cooling is a convection model. It is one of three ways heat moves, and each has its own governing relation.

Heat transfer modeGoverning lawRate depends onExampleDoes Newton's law apply?
ConductionFourier's law, q = -k_solid dT/dxtemperature gradient and conductivityheat moving through a mug wall or a heat sink baseIndirectly: conduction inside the object is why the Biot number matters
Convection, forcedQ_dot = h A (T - T_a) with h nearly constanttemperature difference, airflow or liquid flowa fan cooling a CPU heat sink, wind over Newton's ironYes, this is where the law is most accurate
Convection, naturalsame form, but h grows with the temperature differencetemperature difference, buoyancya mug of coffee on a still deskApproximately; k drifts slowly as the object cools
RadiationStefan-Boltzmann law, Q_dot = ε σ A (T^4 - T_a^4) in kelvinfourth powers of absolute temperaturesa glowing ingot, a satellite in spaceOnly for small temperature differences, through a linearised h
Evaporationlatent heat carried away by vapoursurface vapour pressure, humidity, airflowsteam rising from an uncovered cupNo; it adds a separate, strongly nonlinear loss

The Stefan-Boltzmann constant σ is, per NIST's CODATA listing, exactly 5.670 374 419 × 10⁻⁸ W m⁻² K⁻⁴ (exact because of how the 2019 SI fixed the Boltzmann and Planck constants). We will use it below to see when radiation spoils the exponential.

Worked example 1: how long does coffee take to cool from 90 °C to 60 °C?

A cup of coffee is poured at 90 °C in a room at 20 °C. Five minutes later it reads 80 °C. How long until it reaches 60 °C, a comfortable drinking temperature for many people?

Step 1: find k from the measurement

T_a = 20 °C, T_0 = 90 °C, T(5 min) = 80 °C
Starting difference θ_0 = 90 - 20 = 70 K
Difference at 5 min θ_1 = 80 - 20 = 60 K
k = (1/5 min) × ln(70/60) = 0.2 × 0.15415 = 0.03083 per minute

Step 2: derived quantities

Time constant τ = 1/k = 32.4 min
Half life of the difference = 0.6931/0.03083 = 22.5 min

Step 3: time to reach 60 °C

Target difference θ = 60 - 20 = 40 K
t = (1/k) ln(70/40) = 0.5596 / 0.03083 = 18.2 min

The coffee reaches 60 °C about 18 minutes after pouring, or roughly 13 minutes after the second reading.

Step 4: the full curve

Time (min)Predicted temperature (°C)Difference to room (K)
090.070.0
580.060.0
1071.451.4
1564.144.1
2057.837.8
3047.827.8
4537.517.5
6031.011.0

The first 5 minutes cost 10 K, but the 15 minutes from 45 to 60 cost only 6.5 K: the hotter the coffee, the faster it loses heat.

Step 5: sanity check against physics

Is k = 0.031 per minute plausible? Take a 300 mL ceramic mug of coffee. The liquid alone has a mass of about 0.3 kg and, being mostly water, a specific heat close to 4,180 J/(kg·K), so its heat capacity is about 1,250 J/K, and the mug adds some more. If the effective area losing heat (open top, mug sides) is around 0.03 m², then k = hA/(mc) gives:

h = k m c / A = (0.03083 / 60 s) × 1250 J/K / 0.03 m²
  ≈ 21 W/(m²·K)

That effective h lumps together convection, radiation and evaporation, and the low tens of W/(m²·K) is a plausible order of magnitude. The check exists to catch a k that is off by a factor of sixty because of a seconds versus minutes slip.

Step 6: the classic milk question

Suppose you plan to add 20 mL of cold milk at 5 °C to 200 mL of coffee, and you want the coolest drink 10 minutes from now. Should you add the milk at once or at the end? Treat the mix as a simple volume weighted average (milk and coffee have similar heat capacity per millilitre) and assume k stays at 0.03083 per minute.

Milk now:   mix = (200×90 + 20×5)/220 = 82.27 °C
            after 10 min: 20 + 62.27 × e^(-0.3083) = 65.75 °C
Milk later: coffee after 10 min = 20 + 70 × e^(-0.3083) = 71.43 °C
            mix = (200×71.43 + 20×5)/220 = 65.39 °C

Adding the milk at the end gives a slightly cooler drink, about 0.4 K cooler here. The reason is in the law itself: the hotter the coffee stays during the wait, the faster it sheds heat to the room. Adding milk first lowers the difference and slows the cooling. The effect is small, and the extra volume also changes k, but the direction follows from the equation.

Worked example 2: estimating time since death from body temperature

This is the law's most famous popular application and the one where the plain law is least adequate, which is exactly why it teaches so much. This section describes the published method for education only; real estimates are made by forensic pathologists, combine several methods and are given as a range.

The naive Newtonian estimate

Suppose a body temperature is measured at 30.0 °C in a room at 15.0 °C, and we assume a temperature at death of 37.2 °C (the reference value used in the forensic formula below). If we simply apply Newton's law with a cooling constant of k = 0.0617 per hour (chosen to match the formula's parameter for a 70 kg adult), we get:

t = (1/k) ln( (37.2 - 15) / (30 - 15) )
  = (1/0.0617 h⁻¹) × ln(22.2/15)
  = 16.2 h × 0.392 = 6.4 h

That number is wrong in a systematic way, and forensic research has known why for decades.

Why plain Newtonian cooling does not fit a body

A review of time of death methods published in Diagnostics in 2023 (open access via PubMed Central) states that early studies found Newton's law unsuitable because measured body cooling curves are sigmoidal, not exponential, with a plateau at the start. In physical terms, a body is the opposite of a "lump": its Biot number is large. The core sits under layers of tissue that act as insulation, so the outer layers have to cool first and set up a temperature gradient before the core temperature begins to fall at an exponential rate. For the first hours the measured core temperature changes slowly, and a single exponential calibrated to the later slope will underestimate the elapsed time.

The two exponential model: Marshall and Hoare, then Henssge

Marshall and Hoare published a two exponential description in the Journal of Forensic Sciences in 1962. Claus Henssge, at the Institute of Legal Medicine in Cologne and later Essen, built on it. According to its abstract, his 1988 nomogram paper in Forensic Science International drew on physical considerations, the Marshall and Hoare term and the authors' own cooling experiments, and needs a single rectal temperature measurement to give a result at the scene.

The formula behind the nomogram, as set out in the 2023 Diagnostics review, uses a standardised temperature ratio:

Q = (T_r - T_a) / (37.2 - T_a)

For T_a at or below 23.2 °C:
Q = 1.25 exp(B t) - 0.25 exp(5 B t)

For T_a at or above 23.3 °C:
Q = 1.11 exp(B t) - 0.11 exp(10 B t)

B = -1.2815 × m^(-0.625) + 0.0284     (m in kg, t in hours)

Here T_r is the rectal temperature, T_a the ambient temperature and m the body mass. The fast second term dies away early and produces the plateau; the first term is the Newtonian tail. Body mass enters through B because a heavier body has less surface per unit mass and cools more slowly, as k = hA/(mc) predicts. Clothing, coverings and air movement are handled with empirical corrective factors applied to body weight, studied by Henssge in Forensic Science International in 1992.

Putting numbers in

Using the same case, a 70 kg body, T_r = 30.0 °C, T_a = 15.0 °C and no correction factor:

m^(-0.625) = 70^(-0.625) = 0.07028
B = -1.2815 × 0.07028 + 0.0284 = -0.06166 per hour
Q = (30 - 15)/(37.2 - 15) = 15/22.2 = 0.6757
Solve 1.25 e^(B t) - 0.25 e^(5 B t) = 0.6757 numerically
t ≈ 9.7 h

There is no closed form for t, hence the nomogram. The two models diverge like this:

Hours after deathTwo exponential model (°C)Single exponential with same B (°C)
037.237.2
137.035.9
236.534.6
435.132.4
633.330.3
831.528.6
1029.727.0
1228.125.6

The single exponential reaches 30 °C after about 6.4 hours; the two exponential model takes about 9.7 hours. The three hour gap is the plateau.

What the method can and cannot tell you

The method's own literature is careful about its limits, and any honest explainer should be too.

  • It gives a range. The 2023 review notes that the nomogram's accuracy has been stated as plus or minus 2.8 hours. For the example above, that would mean a window of roughly 7 to 12.5 hours, not "9.7 hours".
  • It assumes stable surroundings. Althaus and Henssge (Forensic Science International, 1999) cooled body like dummies and changed the ambient temperature suddenly by about 15 °C. A sudden drop produced a second, shorter plateau that they could model with a modified constant. For a sudden rise, they found no procedure that modelled the cooling curves.
  • It assumes a normal starting temperature. The constant 37.2 °C is a reference value. Fever or hypothermia before death changes the starting point and the estimate.
  • It is one method among several. Henssge's 1988 companion paper covers integrating different methods. A 2000 study in the International Journal of Legal Medicine used the nomogram within a compound method in 72 consecutive cases and found no contradictions in the 60 cases where police investigations established the time. Henssge and Madea reviewed the early post mortem period in Forensic Science International in 2004.
  • It is an early period method. Once the body approaches ambient temperature, the temperature difference carries little information and temperature based methods lose their power, for the same reason the coffee curve flattens.

Research continues, including machine learning models built on the Henssge formula (the subject of the 2023 review), but the physics lesson is stable: a model that suits a teacup needs serious correction for an object that is large and layered.

Worked example 3: cooling cooked food within food safety limits

What the FDA Food Code requires

The FDA Food Code is a model code that state, local, tribal and territorial agencies adopt for restaurants and retail food, and FDA lists the 2026 edition as the most recent. Section 3-501.14 of the 2026 Food Code keeps the two stage rule: cooked time and temperature control for safety food must cool within two hours from 57 °C (135 °F) to 21 °C (70 °F), and within a total of six hours from 57 °C to 5 °C (41 °F) or less. Food prepared from ingredients at ambient temperature, such as reconstituted foods and canned tuna, must reach 5 °C or less within 4 hours. The 2022 edition used the same limits.

The annex explains that slow cooling has consistently been identified as one of the leading contributing factors to foodborne illness, and that time between about 21 °C and 52 °C (70 °F to 125 °F), near ideal bacterial incubation temperatures, is to be avoided.

Section 3-501.15 lists the cooling methods: shallow pans, smaller or thinner portions, rapid cooling equipment, stirring in an ice water bath, containers that help heat transfer, adding ice as an ingredient, a food depth of no more than 2 inches, or other effective methods. Every one of them raises h, raises A, or cuts the mass per unit area. In other words, every one raises k.

What k does a kitchen need?

Assume a walk-in cooler holds the air at 3 °C. Food starts at 57 °C, so the starting difference is 54 K.

Stage 1: 57 °C to 21 °C within 2 h
  difference falls from 54 K to 18 K, a factor of 3
  required k ≥ ln(3) / 2 h = 1.0986 / 2 = 0.549 per hour

Stage 2: 57 °C to 5 °C within 6 h total
  difference falls from 54 K to 2 K, a factor of 27
  required k ≥ ln(27) / 6 h = 3.2958 / 6 = 0.549 per hour

With a 3 °C cooler the two requirements happen to coincide, at a k of about 0.55 per hour, which means a time constant under about 1.8 hours. With a warmer cooler the second stage gets much harder, because the target of 5 °C sits close to the ambient temperature and the exponential approach slows down as it nears ambient. With an ambient of 4 °C the final difference is only 1 K, a factor of 53 from the start, and the required k rises to about 0.66 per hour.

A deep pot versus shallow pans

Now take a deep stockpot of chili placed in the cooler. After one hour the centre reads 49 °C.

k = ln( (57 - 3) / (49 - 3) ) / 1 h = ln(54/46) = 0.160 per hour
Time to 21 °C: ln(3)/0.160 = 6.9 h     (limit 2 h)
Time to 5 °C:  ln(27)/0.160 = 20.6 h   (limit 6 h)

The pot fails badly. Divide the same chili among shallow pans so that the depth is about a quarter of the pot's. Heat leaves mostly through the top and bottom surfaces, so the area per unit mass rises by roughly a factor of four and so does k:

k ≈ 4 × 0.160 = 0.641 per hour
Time to 21 °C: ln(3)/0.641 = 1.7 h     (limit 2 h, pass)
Time to 5 °C:  ln(27)/0.641 = 5.1 h    (limit 6 h, pass)

The margin is thin, which is why kitchens stack methods.

The catch: food is not a lump

A deep pot of thick food has a large Biot number. The edges cool quickly while the centre lags, so the centre temperature does not follow a single exponential, and the centre is what matters for safety. That is why food safety guidance measures the thickest part or the centre, and why the code's depth rule exists. Newton's law gives the right direction and a useful first estimate; a thermometer in the centre gives the answer.

Worked example 4: the time constant of a heat sink

Electronics designers write the same mathematics as thermal resistance and thermal capacitance.

An aluminium heat sink has a mass of 0.2 kg and a specific heat capacity of about 900 J/(kg·K), so its thermal capacitance is C = mc = 180 J/K. With a fan running, the thermal resistance from the heat sink to the air is R = 0.5 K/W. That R is simply 1/(hA).

Time constant τ = R C = 0.5 K/W × 180 J/K = 90 s

If a chip suddenly starts dissipating 40 W into the heat sink in 25 °C air:

Steady state temperature = T_a + P R = 25 + 40 × 0.5 = 45 °C
Temperature after one time constant (90 s) = 25 + 20 × (1 - e^(-1)) = 37.6 °C
Settled (about 5 τ) after roughly 7.5 minutes

This is Newton's law with a heat source: C dT/dt = P - (T - T_a)/R. Switch the power off and the heat sink cools along a plain Newtonian curve. More airflow lowers R, which both lowers the steady temperature and shortens the time constant.

Real packages have several thermal masses in series, so their response is a sum of exponentials, much like the two exponential body model.

When does Newton's law of cooling fail?

The law is an approximation built on four assumptions: heat loss is proportional to the temperature difference, the object has a uniform temperature, its heat capacity is constant, and the surroundings stay at a fixed temperature. Each can break.

Large temperature differences and radiation

Every surface also radiates. For small differences, radiation behaves like an extra convection term with a linearised coefficient:

h_rad ≈ 4 ε σ T_a³
At T_a = 300 K, ε = 0.95:
h_rad = 4 × 0.95 × 5.670374419e-8 × 300³ = 5.8 W/(m²·K)

That is comparable to natural convection in still air, so radiation always matters in a room. But the linear form is only accurate near ambient. Exact versus linearised net flux, for emissivity 0.95 and surroundings at 300 K:

Surface temperature (K)Exact εσ(T⁴ - T_a⁴) (W/m²)Linearised 4εσT_a³(T - T_a) (W/m²)Linear as a share of exact
31061.258.295 %
350372.0290.978 %
400942.7581.862 %
6006,5451,74527 %
1,00053,4324,0738 %

At a 10 K difference the linear model is within about 5 percent. At a 100 K difference it misses about 38 percent of the radiated heat. At 1,000 K the linear law underestimates radiative loss more than tenfold. Radiation dominated cooling of hot metal, kilns and spacecraft needs the Stefan-Boltzmann law, covered in our Stefan-Boltzmann explainer.

Natural convection is not linear

In forced convection (a fan, a wind tunnel, Newton's steady airflow), h is set mainly by the flow and barely depends on the temperature difference. In natural convection, the flow is driven by buoyancy, which itself comes from the temperature difference. So h itself rises with the temperature difference, and a hot mug in still air cools a little faster than linear when hot and a little slower when nearly cool. The error is modest for a mug, but it is why plots of ln(T - T_a) are often gently curved.

Phase changes and evaporation

When the object changes phase, its temperature stops tracking heat loss. Water freezing in an ice tray sits at 0 °C while it gives up latent heat. A cup of coffee without a lid loses a large share of its heat through evaporation when hot, and evaporation depends on vapour pressure, which rises steeply with temperature, so a lid changes k and the shape of the early curve.

Internal temperature gradients

When the Biot number is not small, different parts of the object are at different temperatures, and the temperature you measure depends on where you measure it. The centre of a large roast, a pot of stock and a human body all show a lagging core and an early plateau. These need the heat conduction equation or a numerical model; the body cooling formula is an empirical two term version.

Changing surroundings and heat sources

The solution assumes a constant T_a. If the room warms during the afternoon, the coffee cools more slowly than predicted; a known ambient history can be handled as a linear equation with a time varying input. A running processor or a charging battery adds a source term, covered in the heat sink example.

Decision table: which model should I use?

SituationModel to useWhy
Small object, forced airflow or stirred liquid, modest temperature differenceNewton's law, exponential solutionh nearly constant, Biot number small, radiation roughly linear
Drink or small dish in still airNewton's law, fitted to measurementsconvection and evaporation fold into an effective k
Object hundreds of kelvin above ambientEnergy balance with the full Stefan-Boltzmann term plus convection, solved numericallyradiation is strongly nonlinear
Large or layered object (pot of food, roast, body)Conduction model, or an empirical multi exponential fitBiot number large, core lags the surface
Object with internal heat generationNewton's law with a source term, or an RC thermal networksteady temperature T_a + PR
Forensic time since deathOnly the published forensic methods, applied by trained practitionersplateau, correction factors and stated error ranges are part of the method

Where Newton's law of cooling shows up in engineering

Electronics thermal design

Heat sink datasheets and board level thermal simulations rest on Q_dot = hA(T - T_a) and its RC network equivalents: thermal resistances combine like electrical resistors, and thermal capacitances set how fast a part heats when load changes. Firmware uses the same idea in reverse, reading on chip temperature sensors and raising fan speed or throttling the clock, and the heat sink's time constant sets how quickly that controller must respond.

Server inlet temperatures and data centres

Each server pulls in air at the inlet temperature and rejects heat to it. A warmer inlet means a smaller difference between component and air, so more airflow or larger heat sinks are needed to remove the same power. That trade between inlet temperature, fan energy and chiller energy is covered in our posts on air versus liquid cooling for AI servers and on how climate and location change data centre cooling.

Battery cooling

Battery packs generate heat when charging and discharging. Battery management systems commonly use lumped thermal models, thermal masses joined by thermal resistances, to estimate cell temperatures between sensors and decide when to run pumps or fans. That is Newton's law with a heat source, extended to several connected nodes.

The software around the physics: an honest bridge

Newton's law of cooling is physics, and Safeguard does not do physics. Safeguard models are single purpose security models for software. They do not calculate cooling constants, size heat sinks, estimate time since death or check food cooling logs, and nothing in this post was computed by them. The connection is narrower. Fan controllers, battery management systems, smart thermostats and kitchen temperature loggers all run firmware and usually talk to companion apps, cloud dashboards and data pipelines, and much of that surrounding code is built from open source dependencies. That is where Safeguard can help: scanning the repositories, container images and SBOM files your team builds for known vulnerable open source components, showing which projects carry a given version and, when a fixed version exists, opening an upgrade pull request for review. It does not scan device firmware or analyse hardware.

Walkthrough: fit a cooling constant with Python

This walkthrough reproduces the coffee example from a set of measurements, fits k from all of them instead of one, and shows how much a single noisy reading can move the answer. It uses only the Python standard library.

Step 1: create an isolated environment

python3 -m venv .venv
source .venv/bin/activate
python3 --version

The script needs no third party packages.

Step 2: record your measurements

Use a probe in the liquid and a separate thermometer for the room, and keep the lid and stirring the same throughout.

Step 3: write the script

Save this as cooling.py:

"""Fit Newton's law of cooling to measured temperatures and predict times."""
import math

T_AMBIENT = 20.0  # degrees C, measured with a separate thermometer
# (minutes, degrees C) readings from a mug of coffee
readings = [(0, 90.0), (2, 85.9), (4, 81.9), (6, 78.5),
            (8, 75.0), (10, 71.5), (15, 64.0), (20, 57.9)]


def fit_k(data, t_amb):
    """Least squares fit of ln(T - T_amb) = ln(dT0) - k t."""
    xs = [t for t, _ in data]
    ys = [math.log(T - t_amb) for _, T in data]
    n = len(xs)
    mx, my = sum(xs) / n, sum(ys) / n
    sxy = sum((x - mx) * (y - my) for x, y in zip(xs, ys))
    sxx = sum((x - mx) ** 2 for x in xs)
    slope = sxy / sxx
    intercept = my - slope * mx
    return -slope, math.exp(intercept)


def time_to_reach(target, dT0, k, t_amb):
    return math.log(dT0 / (target - t_amb)) / k


k, dT0 = fit_k(readings, T_AMBIENT)
print(f"k = {k:.4f} per minute")
print(f"time constant = {1 / k:.1f} min")
print(f"half life of the difference = {math.log(2) / k:.1f} min")
print(f"fitted starting difference = {dT0:.1f} K")
print(f"time to 60 C = {time_to_reach(60.0, dT0, k, T_AMBIENT):.1f} min")
for t, T in readings:
    pred = T_AMBIENT + dT0 * math.exp(-k * t)
    print(f"t={t:>2} min measured {T:5.1f} C model {pred:5.1f} C residual {T - pred:+.2f}")
# single point estimate, for comparison
k1 = math.log((90.0 - T_AMBIENT) / (85.9 - T_AMBIENT)) / 2
print(f"k from the 2 minute reading alone = {k1:.4f} per minute, "
      f"time to 60 C = {math.log(70 / 40) / k1:.1f} min")

Step 4: run it

python3 cooling.py

Output:

k = 0.0308 per minute
time constant = 32.5 min
half life of the difference = 22.5 min
fitted starting difference = 70.1 K
time to 60 C = 18.2 min
t= 0 min measured  90.0 C model  90.1 C residual -0.13
t= 2 min measured  85.9 C model  85.9 C residual -0.03
t= 4 min measured  81.9 C model  82.0 C residual -0.09
t= 6 min measured  78.5 C model  78.3 C residual +0.21
t= 8 min measured  75.0 C model  74.8 C residual +0.20
t=10 min measured  71.5 C model  71.5 C residual -0.03
t=15 min measured  64.0 C model  64.2 C residual -0.17
t=20 min measured  57.9 C model  57.9 C residual +0.04
k from the 2 minute reading alone = 0.0302 per minute, time to 60 C = 18.5 min

The fitted k of 0.0308 per minute matches the two point calculation in worked example 1, and the residuals stay within about 0.2 K, which is the scatter you expect from a kitchen probe. A clean straight line in ln(T - T_a) is the evidence that Newton's law fits this cup.

Step 5: see how fragile a single point is

Change the 2 minute reading from 85.9 °C to 86.2 °C, an error of 0.3 K, and use only that reading:

k = ln(70/66.2) / 2 = 0.0279 per minute
time to 60 °C = 0.5596 / 0.0279 = 20.1 min

A 0.3 K error in one early reading moves the prediction by almost two minutes, about 10 percent. Spread readings over at least one time constant and fit them all.

Step 6: check the residuals for curvature

Residuals positive at both ends and negative in the middle (or the reverse) mean the data are curved; fit only the later part, add a second exponential or use a conduction model.

Step 7: keep the tooling healthy

If this script grows into a data logging service, a dashboard for a kitchen's cooling logs or a lab notebook pipeline, it will start to pull in third party packages. Pin them, rebuild from the lockfile, and scan the repository before each release, for example with safeguard scan --dir ., which writes its results as JSON under ./output.

Common mistakes

  • Mixing temperature scales. Plugging kelvin for the object and Celsius for the room gives a difference that is 273.15 too large. Use the same scale for T and T_a. Differences in K and °C are the same size; absolute values are not.
  • Using temperatures instead of differences. The coffee does not halve its temperature every 22 minutes; its difference to the room does.
  • Ignoring ambient drift. A room that warms by 2 K changes the late curve a lot, because the difference there is small. Log ambient with its own thermometer.
  • Fitting k from one noisy point. As step 5 showed, a 0.3 K error early in the curve can move the prediction by 10 percent. Use several readings across at least one time constant and fit them all.
  • Confusing the time constant with the half life. τ = 1/k; the half life is 0.693/k. Mixing them gives errors of about 44 percent.
  • Forgetting the units of k. A k of 0.031 per minute is 0.00052 per second and 1.86 per hour. Unit slips between minutes and seconds produce answers sixty times off.
  • Extrapolating to large temperature differences. A k fitted near room temperature underpredicts how fast something very hot cools.
  • Treating a large object as a lump. For a pot of food, measure the centre and expect a lag.
  • Using plain Newtonian cooling for time since death. A single exponential underestimates early intervals; the published method exists for that reason.

FAQ

What is Newton's law of cooling in simple terms?

An object cools at a rate proportional to how much hotter it is than its surroundings, so the gap shrinks by the same fraction in every equal interval of time: exponential decay toward room temperature.

What is the formula for Newton's law of cooling?

The rate form is dT/dt = -k (T - T_a). The solution is T(t) = T_a + (T_0 - T_a) e^(-k t), where T_0 is the starting temperature, T_a the ambient temperature and k the cooling constant. For a convectively cooled object with a uniform temperature, k = hA/(mc).

How do you find k in Newton's law of cooling?

Measure the starting temperature, the ambient temperature and one later temperature, then use k = (1/t) ln((T_0 - T_a)/(T - T_a)). For better accuracy take several readings over at least one time constant and fit a straight line to ln(T - T_a) against time; the slope is -k.

Does Newton's law of cooling work in Fahrenheit?

Yes, as long as the object and ambient temperatures are both in Fahrenheit. The law uses only the ratio of temperature differences, and that ratio is the same in Fahrenheit, Celsius and kelvin. You cannot mix scales, and radiation calculations must use kelvin.

Why does Newton's law of cooling fail for large temperature differences?

Radiation grows with the fourth power of absolute temperature and natural convection strengthens with the difference, so very hot objects cool faster at first than a linear law predicts.

How long does it take coffee to cool down?

It depends on the cup, the lid and the room. In our example, coffee at 90 °C in a 20 °C room that reads 80 °C after 5 minutes reaches 60 °C after about 18 minutes and is within about 11 K of room temperature after an hour.

Should you add milk to coffee now or later to cool it faster?

Add it at the end if you want the coolest drink at a set time. Hotter black coffee loses heat faster during the wait. In our example the gain was about 0.4 K after 10 minutes.

How do forensic pathologists estimate time of death from body temperature?

They do not use plain Newton's law. The widely cited method, published by Henssge in 1988, uses a two exponential formula that captures an early plateau, adjusts for body weight and conditions with correction factors, and gives a range. It is used together with other findings in a compound method, mainly in the early period after death.

What are the FDA rules for cooling cooked food?

Under section 3-501.14 of the FDA Food Code 2026, cooked time and temperature control for safety food must cool from 57 °C (135 °F) to 21 °C (70 °F) within 2 hours, and to 5 °C (41 °F) or less within 6 hours in total. Check which edition your jurisdiction has adopted.

Is Newton's law of cooling the same as the Stefan-Boltzmann law?

No. Newton's law is linear in the temperature difference and mainly describes convection. The Stefan-Boltzmann law describes radiation and depends on the fourth power of absolute temperature. For small temperature differences, radiation can be folded into Newton's law as a linearised coefficient of about 6 W/(m²·K) near room temperature.

Why software supply chain hygiene still matters here

The cooling physics itself has nothing to do with software vulnerabilities, so the fit is indirect. But the temperature loggers, fan and battery controllers, kitchen monitoring dashboards and analysis scripts that put this law to work are built and rebuilt from open source dependencies, and those dependencies age and need fixing like any others.

Fix it without waiting for upstream

Whatever the vulnerability, most of the risk sits in two gaps. The first is the time between a fix being published and that fix actually running in your production builds. The second, and worse, is the time before any fix exists at all, while a maintainer works out a patch and a release schedule. Waiting through both gaps is a habit, not a requirement. Safeguard gives teams three ways to close them.

1. Autonomous remediation: pull requests, not tickets

When a fixed version exists, Safeguard's Griffin models open a tested, policy gated pull request that moves the affected dependency to the safe version. You can run it on one repository or in bulk across every project that carries the vulnerable version. Remediation covers eight categories, including dependencies, licenses, security posture and findings. Reachability analysis ranks the vulnerable code paths your application actually calls first, so the first pull requests you merge are the ones that matter most. Autonomous remediation ships switched off, with every category set to Manual, so your team decides how much runs on its own and what still needs a human approval.

2. Gold Open Source: the safe version in seconds, free

gold.safeguard.sh is free and needs no login. Search any CVE or package to see affected and fixed versions, CVSS, EPSS, CISA KEV status and a recommended safe version, or use the "Am I affected?" checker. The same data is available through a free read API, README status badges and RSS threat feeds. The safeguard-sh/gold-scan-action GitHub Action can fail a build on a known exploited vulnerability, on any known vulnerability, or never, so a version you have just removed cannot quietly come back in next week's merge.

3. Gold Registry: start from components that are already fixed

registry.safeguard.sh provides hardened, drop in replacements for upstream packages and container images. Every Gold artifact is held continuously to zero exploitable critical or high CVEs, zero malware and a completed license check, with SLSA L3 or higher provenance, a Sigstore signature and a public evidence page you can hand to an auditor. An artifact loses its Gold badge if it regresses. Teams can point their own package directory at the registry so hardened equivalents resolve without changing how developers install anything.

When upstream has no fix yet, or will not ship one, Safeguard first works to get the fix accepted upstream. If the issue is severe or upstream will not move, Safeguard builds a fork, fixes the vulnerability there and publishes a hardened Gold build, so you are not stuck on a maintainer's release schedule. You can also request a hardened, compatibility tested build of a specific package. This fork and patch flow is in early access today, so ask which packages it covers before you plan around it.

Your situationWhat to use
A fixed version existsAutonomous remediation opens the upgrade pull request; Gold Open Source confirms the safe version
You need to know today whether you are affectedGold Open Source lookup and "Am I affected?" checker, free and without login
You want vulnerable versions to stop shippingThe Gold scan GitHub Action in CI, plus Safeguard policies and gates
Upstream has no fix yet, or will not ship oneA custom Gold request; fork and patch (early access)
You want to start clean on new projectsPull hardened components and images from Gold Registry

One honest limit: when the vulnerable code lives in a vendor appliance, a hosted service or an operating system runtime you do not build yourself, the fix still has to come from that vendor or distribution. The steps above apply to the open source dependencies and container images you build and ship, which is where most teams carry the largest and least tracked share of their exposure.

See how Safeguard would help

None of these demos involve heat transfer or any calculation from this post; they show the software side described in the bridge above.

The first demo is a real Safeguard CLI session: it installs the CLI, opens the interactive terminal and asks it to fix a lodash CVE in a repository. It reads the finding and advisory, asks before any command that changes something, edits package.json to lodash 4.17.21, runs npm install and npm test with approval, prints a summary and pushes nothing. The same flow applies to a temperature logging dashboard or a fan control web interface your team maintains: scan the repository, then let the assistant propose the dependency upgrade under your approval.

Click through it at your own pace, or open it full screen.

The second demo sets up the Safeguard runner on your own machine, approves it with its device code and then scans from the terminal. That suits engineering teams who keep thermal test scripts, data acquisition code or cooling log tooling on their own hardware and want the scan to run where the code lives.

Click through it at your own pace, or open it full screen.

The third demo connects Claude to the Safeguard MCP server with OAuth and lets you choose which tools Claude can use. For an engineer who already works with Claude while writing a sensor data pipeline or a cooling analysis notebook, it brings dependency findings into the same conversation, limited to the tools you allow.

Click through it at your own pace, or open it full screen.

To try it on your own repositories, download Safeguard and follow the CLI documentation.

Quick check

A walk-in cooler holds 3 °C. What cooling constant does food starting at 57 °C need to meet the 2 hour stage of the Food Code rule?

The difference must fall from 54 K to 18 K, a factor of 3, in 2 hours. So k must be at least ln(3)/2 = 0.55 per hour, a time constant of about 1.8 hours or less.

Why does a single exponential underestimate time since death early on?

A body is not a lump: its core is insulated by outer tissue, so measured core temperature shows an initial plateau before falling. A single exponential has no plateau, so it predicts faster early cooling and a shorter elapsed time than the two exponential forensic model.

Sources

Last reviewed: 25 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.