First differences and period-over-period deltas

Paste a number series and see how much it moves from row to row — as an absolute delta, a percent change, a ratio, or a log difference, at any lag and any order.

Try:
Differences (JSON)

About this tool

Use this first difference calculator when you have a series of ordered numbers and want the row-to-row movement, a seasonal lag, or second differences for a quick linear/quadratic check. Paste values separated by spaces, commas, semicolons, or newlines; the tool keeps the output aligned to the original row numbers by default so you can trace every result back to its source row.

Worked example: for 120, 135, 150, 148, 161 with lag = 1, order = 1, and mode = difference, the aligned values are [null, 15, 15, -2, 13]. The first value is null because there is no previous row to compare against. Switch to mode = percent and drop_warmup = true to get signed period-over-period percent changes such as 12.5, 11.111111, -1.333333, and 8.783784.

Common settings:

Limits and edge cases: the input must contain 2 to 20,000 finite numbers. lag can be negative for lead-style comparisons, but it cannot be zero. A zero baseline in percent or ratio mode, or a non-positive value in log mode, is returned as null and counted in summary.undefined rather than as infinity.

FAQ

What is a first difference?

A first difference subtracts the previous value from the current value. For 2, 5, 9, 14, the aligned first differences are null, 3, 4, 5 because the first row has no previous value.

How is percent mode different from ratio mode?

Percent mode returns (current - baseline) / baseline × 100, so 100 → 110 is 10. Ratio mode returns current / baseline, so the same move is 1.1. Both are directional period-over-period measures, not the symmetric two-number percent difference used by some calculators.

Why does the output contain null values?

null means either there is no baseline row for that position, or the comparison is mathematically undefined. Keep the default aligned output when row numbers matter; enable “Drop the warm-up rows” when you want the shorter list of computed values only.

Can I compute seasonal or second differences?

Yes. Use a larger lag for seasonal differencing, such as 12 for monthly data. Use order = 2 for second differences; constant second differences are a quick signal of a quadratic pattern when the input rows are evenly spaced and ordered.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool first-difference-calculator "120, 135, 150, 148, 161"

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/first-difference-calculator/?series=120%2C%20135%2C%20150%2C%20148%2C%20161&lag=1&order=1&mode=difference&decimals=6&drop_warmup=true

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.