Newton's law of cooling calculator
Coffee at 90 °C in a 20 °C room, with a cooling constant of 0.05 per minute, has cooled to 62.457146179884 °C after 10 minutes. Enter the surrounding temperature, the starting temperature, the constant and the time to see each step. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Ambient
- 20
- T0
- 90
- Cooling
- 0.05
- T
- 10
- Ambient
- 20
- Ambient temperature
- 20
- Initial
- 90
- Initial temperature
- 90
A Newton's law of cooling calculator turns ambient temperature, initial object temperature, cooling constant, and elapsed time into the object's temperature at that moment. Enter Ta, T0, k, and t; the tool returns T(t) equals Ta plus the initial difference times e to the minus k t, plus a readable equation string, the exponential factor, a cooling or heating regime label, and ordered substitution steps. Lab write-ups, homework checks, coffee-and-room-temperature demos, and coding kata expected values all need the same closed-form exponential without opening a full ODE solver.
What Newton's law of cooling states
Newton's law of cooling says that the rate at which an object's temperature changes is proportional to the difference between the object temperature and the ambient (surrounding) temperature. In differential form that is dT over dt equals minus k times (T minus Ta), where k is a positive cooling constant that depends on geometry, surface conditions, and units of time.
Solving the first-order equation with initial condition T of zero equals T0 yields the closed form T of t equals Ta plus (T0 minus Ta) times e to the power of minus k t. When T0 is above ambient the exponential decays and the object cools toward Ta; when T0 is below ambient the same formula describes warming toward Ta; when T0 already equals Ta the temperature stays flat for every t.
Teachers and automated graders care about the negative-time rejection as much as the successful path: a student who plugs t less than zero into a forward cooling model has left the usual homework domain, and a silent extrapolation would hide that mistake. The check path recomputes the exponential factor and the linear combination with the same fixed rounding used for published fields, so a successful response always ships with steps you can assert in tests or worksheets.
Practical tips, limits, and related searches
Keep Ta and T0 in the same temperature unit—degrees Celsius, kelvin, or Fahrenheit all work because only their difference enters the formula—and keep k in inverse units of the time you pass for t. Prefer sending numbers rather than pre-formatted strings when you control the client; string numbers are accepted only when they match a strict finite numeric pattern. For very large k times t the exponential underflows toward zero and the temperature settles at ambient, which is the correct physical limit of long cool-down.
Prefer this capability when you already have Ta, T0, k, and t and only need T(t); if your source is a lab log, extract those four numbers first. Round-trip checks are easy: recompute Ta plus (T0 minus Ta) times Math.exp of minus k times t by hand and confirm it equals the published temperature within the same twelve-decimal rounding.
What you can do with it
Homework checks for cooling curves
Students enter Ta, T0, k, and t from textbook problems and compare hand-written T(t), exponential factor, and steps against a deterministic result before submitting.
Lab demos of coffee or metal cooling
Instructors fix ambient and initial temperatures, vary k or t, and show how the object approaches room temperature without a full simulation stack.
FAQ
What is Newton's law of cooling?
It states that dT/dt = −k(T − Ta). The solution with T(0) = T0 is T(t) = Ta + (T0 − Ta)·e^(−k·t).
What happens if time is negative?
The forward cooling model is defined for non-negative elapsed time.
Can I use Celsius and minutes together?
Yes. Ta and T0 must share the same temperature unit; k must be the inverse of the time unit of t (for example 1/min if t is in minutes).
Does this estimate the cooling constant k?
No. You supply k (or an equivalent rate). Use a curve-fit or log-linear regression offline if you only have temperature samples.
Is the Newton's law of cooling calculator free?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/thermo/newton-cooling \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"ta":20,"t0":90,"k":0.05,"t":10}'const res = await fetch("https://api.kit.forhosting.com/thermo/newton-cooling", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"ta": 20,
"t0": 90,
"k": 0.05,
"t": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/thermo/newton-cooling",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"ta": 20,
"t0": 90,
"k": 0.05,
"t": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/thermo/newton-cooling", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"ta":20,"t0":90,"k":0.05,"t":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"ta":20,"t0":90,"k":0.05,"t":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/thermo/newton-cooling", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"ta": 20,
"t0": 90,
"k": 0.05,
"t": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "thermo.newton_cooling",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_abs | 1000000000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
When time is negative the model is outside its usual forward domain, so the API returns a clear invalid_input error instead of inventing a past trajectory.
How to call the API and what comes back
Cooling constant k must be non-negative for the standard model. Send a JSON body with four required finite numbers: ta (aliases ambient, ambient_temperature, T_a, T_env, env_temp, surrounding), t0 (aliases initial, initial_temperature, T_0, T0, object_temp, start_temp), k (aliases cooling_constant, kappa, rate, cooling_rate, lambda), and t (aliases time, elapsed, duration, minutes, seconds). Absolute values must stay within the published limit of one trillion so intermediate products remain finite in IEEE double precision on the Worker and in the browser. Time t must be non-negative; negative values are rejected with invalid_input. On success the response echoes rounded ta, t0, k, and t, sets temperature, T, and T_t to the same rounded T(t), delta_t0 to the initial difference T0 minus Ta, exp_factor to e to the minus k t, formula to the closed-form string, equation to a human-readable substitution line, law to Newton, regime to cooling, heating, or equilibrium, message to a short English summary, and steps to an ordered array of derivation lines. Failed validation—missing fields, non-finite numbers, values outside absolute limits, negative time, or negative k—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and related searches
When teaching, pair examples: hot coffee at ninety degrees in a twenty-degree room with k equals zero point zero five for ten minutes cools toward ambient; an ice pack below room temperature warms with the same formula; t equals zero recovers T0 exactly; and a deliberate negative time demonstrates the hard invalid_input path. This landing targets people searching for a Newton's law of cooling calculator, temperature over time from ambient and k, or object cooling exponential online; it is not a heat-conduction wall calculator, not an ideal-gas solver, and not a tool that estimates k from measured data points. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately set time negative.
Integration use cases
Unit tests for ODE or exponential utilities
Generate known-good cooling, heating, equilibrium, and deliberate negative-time rejections for coding kata expected values.