CPI & Inflation Rate Calculator
Build the Consumer Price Index from a basket of goods, or plug in two CPI values directly to get the inflation rate between them. See exactly which items in the basket are driving inflation, convert an amount between two years' dollars, and get annualized rates whenever your two years aren't consecutive.
Background
The Consumer Price Index tracks the cost of a fixed "basket" of goods and services over time. Comparing that cost between a base year (CPI = 100, by definition) and a later year gives the CPI for that later year — and the percent change in CPI between two years is the inflation rate. The same basket, priced at two different points in time, is the entire idea behind CPI.
How to use this calculator
- Choose Build the CPI if you have prices for a basket of goods in two years, or Inflation Rate if you already have two CPI values.
- In basket mode, add or remove items, then enter a fixed quantity and a price for each year — the quantities stay the same, only prices change.
- In direct mode, enter the two CPI values and (optionally) an amount to convert between the two years' dollars.
- Click Calculate to see the CPI, the inflation rate, which items drove it, and a full step-by-step solution.
How CPI & inflation work
Step 1 — Price a fixed basket twice. Pick a representative set of goods and services, hold the quantities fixed, and find the total cost of that exact basket in a base year and in a later year.
Step 2 — Build the index. The base year is defined as CPI = 100. Every other year's CPI is just that year's basket cost divided by the base year's basket cost, times 100.
Step 3 — Take the percent change. The inflation rate between two years is simply the percent change in CPI between them — the same math as any growth rate.
Step 4 — Look at what's driving it. Because CPI is a weighted average, an item can have a huge price jump but barely move the index if it's a small part of the basket — or a modest price jump can dominate inflation if it's something people spend a lot on (like rent).
Formula & Equations Used
Cost of the basket: Σ (quantity × price) across all items, for a given year
CPI: CPI = (Cost of basket in given year ÷ Cost of basket in base year) × 100
Inflation rate: (CPI₂ − CPI₁) ÷ CPI₁ × 100%
Annualized rate (CAGR): (CPI₂ ÷ CPI₁)^(1 ÷ Years) − 1 — needed whenever the two years are more than one year apart.
Item contribution to inflation: (item's share of the base-year basket) × (item's own % price change) — these contributions sum exactly to the total inflation rate.
Converting an amount between years: Amount in Year B = Amount in Year A × (CPI_B ÷ CPI_A)
Example Problems & Step-by-Step Solutions
Example 1 — Building the CPI from a basket
A basket has bread (20 loaves, \$2.00 → \$2.50), milk (10 gal, \$3.00 → \$3.30), gas (50 gal, \$3.00 → \$3.90), and rent (1 unit, \$1,200 → \$1,320).
Step 1: Base-year cost = 20(2.00) + 10(3.00) + 50(3.00) + 1(1200) = \(1,420. Current-year cost = 20(2.50) + 10(3.30) + 50(3.90) + 1(1320) = \)1,598.
Step 2: CPI = 1,598 ÷ 1,420 × 100 = 112.54. Inflation = 12.54%.
Result: Even though gas jumped 30% and rent only 10%, rent contributes more to inflation (8.45 points) than gas (3.17 points) — because rent is 84.5% of the basket's cost, and gas is only 10.6%.
Example 2 — Multi-year gap
CPI was 100 five years ago and is 125 today.
Step 1: Total inflation over 5 years = (125 − 100) ÷ 100 = 25%.
Step 2: Annualized: (125 ÷ 100)^(1/5) − 1 ≈ 4.56% per year.
Why it matters: reading "25%" as an annual rate would overstate how fast prices were actually rising each year by more than 5×.
Example 3 — Deflation
CPI falls from 100 to 97 over one year.
Step: Inflation = (97 − 100) ÷ 100 = −3.00% — prices fell 3% on average, a deflationary year.
Note: sustained deflation carries its own risks (like delayed spending, since goods may be cheaper later) — it isn't simply "good" for consumers.
Example 4 — Converting an amount for inflation
You earned \$50,000 in a year when CPI was 100. CPI is now 140.
Step: Equivalent today = \(50,000 × (140 ÷ 100) = \)70,000.
Result: you'd need \$70,000 today to have the same purchasing power that \$50,000 had back then.
Frequently Asked Questions
What's the difference between CPI and the GDP deflator?
CPI tracks a fixed basket of goods households buy, including imports, and is updated periodically. The GDP deflator covers everything produced domestically, with a basket that automatically shifts as the economy changes. They usually move together but can diverge — a spike in imported oil prices shows up more directly in CPI than in the GDP deflator.
Why does the base year always have a CPI of exactly 100?
Because CPI is defined relative to the base year — it's the same basket's cost divided by itself, times 100. That's not a measured value, it's a reference point everything else is compared against.
Why do economists also look at "core" CPI?
Core CPI excludes food and energy prices, which swing sharply for reasons that have little to do with the underlying trend in inflation (a bad harvest, an oil shock). Core CPI is often a better signal of where inflation is actually heading, even though headline CPI is what affects household budgets directly.
Does a fixed basket cause any bias?
Yes — a few well-known ones. Substitution bias happens because a fixed basket can't reflect people switching to cheaper alternatives when relative prices change. Quality-change bias happens when a product improves but its price also rises, making it hard to tell how much of the increase is "inflation" versus "you're getting a better product." Statistical agencies adjust for these, but imperfectly.
How is "contribution to inflation" different from an item's price change?
An item's own price change (say, +30%) ignores how much people actually spend on it. Contribution multiplies that price change by the item's share of total basket spending, so a big price swing in something people barely buy contributes very little, while a modest swing in something people spend heavily on (like rent) can dominate the overall number.
Can I use this for a country other than the US?
Yes — the math is entirely general. Pick your own currency in the preferences above, and build a basket using items and prices relevant to whichever economy you're studying.