CPI inflation calculator
Type the earlier and later CPI readings and get the inflation rate between them: an index going from 100 to 103 is 3% inflation. You also see the later-to-earlier ratio and whether prices rose, fell or held. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Cpi earlier
- 100
- Cpi later
- 103
- Inflation rate
- 3
- Ratio
- 1.03
- Price change
- inflation
The Consumer Price Index is the headline measure statistical agencies publish to summarize the price of a fixed basket of goods and services. Comparing two CPI prints is how analysts, journalists, and households turn those index levels into an inflation rate: the later index minus the earlier index, divided by the earlier index, times one hundred. This CPI inflation calculator accepts the two index values, applies that identity, and returns the percentage change together with the later-to-earlier ratio and a label for inflation, deflation, or no change. It does not fetch official series, seasonally adjust, annualize a multi-year gap, or convert a money amount through the index.
What CPI inflation means and how the percent change is defined
The Consumer Price Index is an index number, not a percent. Statistical agencies set a reference period to one hundred and then rescale later baskets so that a print of one hundred twenty means the measured basket costs twenty percent more than it did in that base period. That is why two raw CPI levels are enough to recover the inflation rate between those two dates: subtract the earlier index from the later index, divide by the earlier index, and multiply by one hundred.
The same identity is the textbook percentage change used in every introductory macroeconomics course and in every press briefing that quotes year-over-year inflation from a pair of CPI prints. A later print above the earlier print is inflation; a later print below the earlier print is deflation; identical prints mean prices were unchanged on this measure. The earlier index is the denominator, so it must be strictly positive.
A zero earlier CPI would send the division to infinity, and a negative earlier CPI would reverse the economic sign of the change; this calculator rejects both cases instead of returning Infinity, NaN, or a fabricated rate. The later index may sit above, equal to, or below the earlier one, including zero, because a collapse of the measured basket is a real deflation of one hundred percent.
This tool does not annualize a multi-year gap, does not rebase one series onto another, and does not fetch official numbers from a statistical office. It evaluates the closed form on the two numbers you already have from a release, a textbook problem, or a spreadsheet.
What you can do with it
Year-over-year CPI briefings
Turn two official Consumer Price Index prints from a statistical release into the headline inflation rate a newsroom or research desk can quote.
Classroom and homework oracles
Generate reproducible percentage-change answer keys that reject a zero or negative earlier CPI instead of printing Infinity.
Wage, rent, and COLA checks
Compare last period’s CPI with this period’s CPI when a cost-of-living clause, rent review, or wage adjustment is written against measured prices.
FAQ
Does this tool fetch official CPI series or annualize multi-year gaps?
No. You supply both index levels. The calculator does not download statistical-office data, rebase series, or convert a multi-year gap into an annual rate.
How do I calculate inflation from two CPI numbers?
Subtract the earlier index from the later one, divide by the earlier index and multiply by one hundred. An index that moves from 100 to 103 gives an inflation rate of 3%.
What does a CPI reading of 103 actually mean?
The CPI is an index number, not a percent. Agencies set a base period to 100, so a reading of 103 means the measured basket costs 3% more than it did in that base period.
What if the later CPI is lower than the earlier one?
Then the result is negative and labelled deflation. Equal readings are labelled unchanged. The later value can even be zero, which is a deflation of one hundred percent.
Why can't the earlier CPI be zero or negative?
It is the number you divide by. Zero would send the result to infinity and a negative value would flip the meaning of the change, so the calculator rejects both rather than invent a rate.
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/fin/cpi-inflation \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"cpi_earlier":100,"cpi_later":103}'const res = await fetch("https://api.kit.forhosting.com/fin/cpi-inflation", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"cpi_earlier": 100,
"cpi_later": 103
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fin/cpi-inflation",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"cpi_earlier": 100,
"cpi_later": 103
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fin/cpi-inflation", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"cpi_earlier":100,"cpi_later":103}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"cpi_earlier":100,"cpi_later":103}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fin/cpi-inflation", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"cpi_earlier": 100,
"cpi_later": 103
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fin.cpi_inflation",
"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.
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
Input contract, response shape, and error behaviour
The value must be a finite number strictly greater than zero. Failed validation does not consume balance. POST a JSON body with two required finite numbers. cpi_earlier is the Consumer Price Index of the earlier period and is the denominator of the percent change; aliases earlier_cpi, cpi0, and base_cpi are accepted so spreadsheets can keep familiar column names. If cpi_earlier is missing, empty, infinite, zero, or negative, the task fails with invalid_input naming cpi_earlier; that is the contracted error and it is not billed. cpi_later is the Consumer Price Index of the later period; aliases later_cpi, cpi1, and current_cpi map to the same field. It must be a finite number and may be higher, equal, or lower than the earlier print. Each field may arrive as a JSON number or a numeric string. On success the body echoes cpi_earlier and cpi_later, returns inflation_rate as the percentage change rounded half-up to six decimal places, returns ratio as later divided by earlier rounded to eight decimal places, sets price_change to inflation, deflation, or unchanged according to the sign of the rate, and includes a formula string restating the identity. Example: earlier one hundred and later one hundred three yields inflation_rate three, ratio one point zero three, and price_change inflation. Earlier two hundred fifty and later two hundred thirty-seven point five yields inflation_rate negative five and price_change deflation.
Where a CPI inflation calculator earns its keep
Newsrooms, research desks, and classrooms use a CPI inflation calculator when a statistical release prints two index levels and the question is the percent change, not a forecast of purchasing power years ahead. Households compare last year’s CPI with this year’s to see how a rent clause, a wage review, or a savings balance should be read against measured prices. When you later need to inflate a money amount across many years at a quoted rate, use a compound-growth identity rather than stretching this two-print CPI contract. Product teams wire the same contract into briefing tools so a reporter who types two official prints sees the identical inflation_rate the API will later return in a test suite. Keep requests small, pin the rounded inflation_rate and ratio in tests, and you get reproducible percentage changes for worksheets, LMS plugins, and edge workers without standing up a statistical-office client of your own.
Technical questions
How do I calculate the inflation rate from two CPI values?
Send finite numbers cpi_earlier (strictly positive) and cpi_later. The API returns inflation_rate = (cpi_later − cpi_earlier) / cpi_earlier × 100, plus the later-to-earlier ratio and a price_change label.
What happens if the earlier CPI is zero or negative?
The task fails with invalid_input naming cpi_earlier. A zero or negative denominator makes the percent change undefined or economically reversed, so the request is not billed.
Can the later CPI be lower than the earlier CPI?
Yes. A later print below the earlier print is deflation: inflation_rate is negative and price_change is deflation. Equal prints return zero with price_change unchanged.
What does the CPI inflation calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.