Climate Running Mean Smoother Calculator
A climate record often combines a long-term signal with noisy year-to-year or month-to-month variation.
Run — free
This calculator applies a centered running mean so the value at each eligible center represents an equal number of observations before and after it. Supply an ordered numeric series and an odd window length, and it returns the complete-window means together with clear alignment indexes. The calculation is deterministic, runs without network access, and rejects a window that is longer than the data series.
Choose a window that matches the climate question
A running mean is useful only when its window reflects the timescale you want to examine. For annual observations, a three-year window softens isolated warm or cool years while retaining relatively short changes; an eleven-year window emphasizes broader variability and suppresses much more interannual noise. For monthly observations, thirteen points cover approximately one year while retaining a unique center month. This calculator requires an odd window because every output must align with one actual observation at the middle of the window. Enter the observations in chronological order and keep their sampling interval consistent. Do not mix monthly and annual values, or insert values from irregular dates, unless you have first resampled the record onto a regular timeline. The tool treats every position as equally spaced and equally weighted. It does not know whether a number is temperature, precipitation, sea level, an anomaly, or another climate indicator, so retain the original unit and describe it alongside any exported result. A larger window creates a smoother curve but also removes more short-term structure and yields fewer output values. Choose it from the scientific purpose, not merely from whichever curve looks most attractive.
Understand centering, edges, and returned indexes
For an odd window of width w, each mean uses the center observation plus the same number of observations on either side. A five-point calculation at input index 6 therefore averages indexes 4 through 8. The first and last parts of a series cannot support a complete centered window because observations are missing on one side. Rather than pad those edges, repeat endpoint values, or silently switch to smaller windows, this calculator omits incomplete positions. The response reports half_window, first_center_index, and last_center_index so you can align every returned mean precisely with the source record. All indexes are zero-based. The first item in smoothed_values belongs at first_center_index, the next belongs one position later, and the final item belongs at last_center_index. The number of results is the input length minus the window plus one. When the window equals the series length, exactly one result is returned and it is centered on the middle observation. When the window is one, every input value is returned unchanged. If the window exceeds the available observations, the request fails instead of returning an ambiguous or partial calculation.
Interpret a smoothed series responsibly
Smoothing helps reveal structure, but it does not create new evidence or establish a trend by itself. A centered mean blends neighboring observations, reduces the apparent size of isolated extremes, and makes adjacent output values statistically dependent because their windows overlap. Preserve the unsmoothed series when reporting results, state the window length and sampling interval, and avoid comparing smooths produced with different windows as though they were equivalent measurements. Missing data needs attention before calculation. The input accepts only finite numbers, so gaps cannot be represented by null, NaN, or infinity. Decide whether a gap should be interpolated, left as a break, or handled with a method designed for incomplete records, and document that choice outside this tool. Also consider whether equal weighting is appropriate. This capability calculates a simple arithmetic mean; it does not apply Gaussian weights, seasonal adjustment, area weighting, uncertainty propagation, or robust outlier resistance. It is well suited to exploratory charts, reproducible preprocessing, and a transparent summary of regularly sampled observations. For formal climate attribution or inference, use the smoothed output as one descriptive component and retain the original record, metadata, uncertainty estimates, and domain-specific statistical analysis.
What you can do with it
Smooth annual temperature anomalies
Reduce isolated year-to-year variation while keeping each mean aligned with the central year.
Prepare a climate dashboard series
Generate a reproducible smooth and explicit alignment indexes for plotting beside raw observations.
Compare smoothing windows
Calculate several odd windows separately to examine which timescales remain visible in the record.
FAQ
Why must the window be odd?
An odd window has one unambiguous center observation with the same number of values before and after it.
What happens at the ends of the series?
Positions without a complete centered window are omitted. The returned center indexes show where the results align.
What happens if the window is longer than the series?
The calculator returns an invalid-input error because no complete window can be formed.
Can the series contain missing values?
No. Every observation must be a finite number. Handle or document missing data before running the calculation.
Does this calculate a weighted moving average?
No. Every observation inside a window receives equal weight in a simple arithmetic mean.
How much does the API request cost?
The API price is $0.002 per request. The browser calculation is available without network processing.
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/earth/climate-moving-average \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"values":[12.1,12.8,11.9,13.2,14,13.7,14.5],"window":3}'const res = await fetch("https://api.kit.forhosting.com/earth/climate-moving-average", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"values": [
12.1,
12.8,
11.9,
13.2,
14,
13.7,
14.5
],
"window": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/earth/climate-moving-average",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"values": [
12.1,
12.8,
11.9,
13.2,
14,
13.7,
14.5
],
"window": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/earth/climate-moving-average", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"values":[12.1,12.8,11.9,13.2,14,13.7,14.5],"window":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"values":[12.1,12.8,11.9,13.2,14,13.7,14.5],"window":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/earth/climate-moving-average", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"values": [
12.1,
12.8,
11.9,
13.2,
14,
13.7,
14.5
],
"window": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "earth.climate_moving_average",
"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_items | 100000 |
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. |