ForHosting KIT · Science

Diurnal temperature range calculator

Measure how much your days swing between warm and cool: highs of 28, 30 and 26 with lows of 12, 14 and 11 give daily ranges of 16, 16 and 15, a mean of fifteen and two-thirds degrees. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

Diurnal temperature range, often written DTR, is the difference between the highest and lowest air temperature recorded on the same calendar day. Climatologists, agronomists, and urban-heat researchers use mean DTR over weeks or seasons as a compact climate statistic: clear dry air and continental interiors tend to show large ranges, while cloudy, humid, or maritime regimes compress them. This diurnal temperature range calculator accepts a series of daily maximum and minimum pairs, computes each day’s range as maximum minus minimum, and returns the arithmetic mean of those ranges together with the per-day values, the sum, and the smallest and largest daily ranges in the series.

What diurnal temperature range measures and why the mean matters

Daily maximum and minimum temperatures are the most widely archived climate variables on Earth. Their difference—the diurnal temperature range—captures how much the surface layer warms by afternoon and cools by night under the local radiation, humidity, cloud, and wind regime. A single-day DTR is useful for weather summaries and for temperature-driven formulas such as Hargreaves reference evapotranspiration, but climate monitoring, crop risk, and urban canopy studies usually need a multi-day or multi-month average so one anomalous day does not dominate the story.

Mean DTR over a month can fall when humidity or cloud cover rises, when irrigation or reservoir moisture increases nighttime temperatures, or when urban heat islands keep nights warmer. It can rise under drought, clear skies, and strong radiative cooling. This calculator does not invent missing extremes or gap-fill gaps; it only evaluates the pure arithmetic identity DTR equals Tmax minus Tmin for each supplied day and the mean of those values.

You keep full control of quality control, units, and which days enter the series.

Who uses the mean diurnal temperature range

Agriculture and phenology models use multi-day average DTR as a stress or cloudiness proxy when full radiation data are missing. Urban heat island studies compare mean DTR between city and rural paired stations to quantify nighttime warming. Teaching labs and exam generators need a deterministic oracle that rejects inverted max/min pairs instead of silently returning NaN from a spreadsheet.

Research notebooks reprocessing historical daily extremes can batch-evaluate mean DTR for monthly climate normals without standing up a full climate toolkit. Keep each day’s maximum at least its minimum, pin the rounded mean in tests, and you get reproducible diurnal temperature range statistics for courses, docs, and edge workers without shipping a meteorology library to every client.

Climate monitoring and station dashboards

Compute mean diurnal temperature range over a week, month, or season from daily Tmax/Tmin archives for climate normals and anomaly panels.

Agriculture and urban heat studies

Compare multi-day average DTR between irrigated fields, dryland sites, or urban versus rural stations as a simple humidity and heat-island proxy.

What happens if maximum temperature is below minimum on a day?

A maximum below its matching minimum is not a valid diurnal range and is not billed.

How many days can I send in one call?

Between 1 and 366 days inclusive—enough for a full leap year of daily extremes. Longer series should be split or pre-aggregated on your side.

What does a large diurnal temperature range tell me?

Usually clear, dry air or an inland location, where afternoons heat up and nights cool strongly. Cloud, humidity and coastal air compress the range, while drought and clear skies widen it.

Does the range work with Fahrenheit readings?

Yes, provided every day is in Fahrenheit. The values are treated as plain numbers and the ranges come back in the same degrees you entered, since no unit conversion takes place.

Does the calculator fill in missing days?

No. It never invents missing highs or lows and never fills gaps; it averages only the days you supply. Quality control and the choice of days stay entirely in your hands.

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.

POSThttps://api.kit.forhosting.com/earth/diurnal-temperature-range

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.

curl -X POST https://api.kit.forhosting.com/earth/diurnal-temperature-range \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"days":[{"t_max":28,"t_min":12},{"t_max":30,"t_min":14},{"t_max":26,"t_min":11}]}'
{
  "days": [
    {
      "t_max": 28,
      "t_min": 12
    },
    {
      "t_max": 30,
      "t_min": 14
    },
    {
      "t_max": 26,
      "t_min": 11
    }
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "earth.diurnal_temperature_range",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

When any day’s maximum sits below its matching minimum the task fails with invalid_input so pipelines never silently average a negative nonsense range.

What diurnal temperature range measures and why the mean matters

Supply the same unit on every day—typically degrees Celsius for operational climate work, though Fahrenheit works if every pair uses Fahrenheit—because the capability treats temperatures as pure numbers and reports ranges in temperature_degrees without converting units.

Input contract, response shape, and error behaviour

At least one day and at most three hundred sixty-six days are accepted so a full leap year of daily extremes can be scored in one call. Numeric strings are coerced when they parse as finite decimals. All numeric outputs are rounded to twelve decimal places for stable goldens across runtimes. Example: three days with maxima twenty-eight, thirty, and twenty-six and minima twelve, fourteen, and eleven produce daily ranges of sixteen, sixteen, and fifteen and a mean diurnal temperature range of fifteen and two-thirds degrees. POST a JSON body with one required field days: a non-empty array of objects, each with t_max and t_min as finite numbers. Each object may also use common aliases such as tmax, temp_max, or max for the maximum and tmin, temp_min, or min for the minimum; the canonical names remain t_max and t_min. Missing days, a non-array days field, empty series, non-object items, missing temperatures, non-finite values, and magnitudes beyond one million fail with invalid_input naming the problem. On success the body includes day_count; mean_dtr as the arithmetic mean of daily ranges; sum_dtr; min_dtr and max_dtr over the series; unit temperature_degrees; formula and equation strings for display; a daily array echoing each rounded t_max, t_min, and dtr; and steps for teaching UIs. Failed validation is not billed; successful analytic calls use the published $0.002 base price with no model tokens and no outbound network.

Where a diurnal temperature range API earns its keep

Operational climate dashboards often need a rolling mean DTR column beside mean temperature and precipitation totals; calling a tiny parse endpoint avoids embedding range logic in every language that touches the station feed.

Teaching and QA oracles

Give students a deterministic mean DTR check and reject any day where maximum temperature is below minimum as invalid_input.

How do I calculate mean diurnal temperature range?

Send days as an array of {t_max, t_min} pairs. For each day DTR = t_max − t_min; the API returns mean_dtr as the arithmetic average of those daily ranges plus the per-day list.

Which temperature units should I use?

Use the same unit for every t_max and t_min in the series, typically °C. The calculator does not convert units; ranges are reported as temperature_degrees in whatever unit you supplied.

What does the diurnal temperature range calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →