{
  "id": "cpi",
  "version": "27bf17412d01",
  "status": "published",
  "name": "CPI Calculator",
  "question": "How do I calculate the CPI?",
  "summary": "Computes a consumer price index from the cost of a basket of goods, and the inflation between two CPI values, typed or the BLS CPI-U yearly averages since 1913.",
  "category": "finance",
  "subcategory": "investing",
  "url": "https://www.acalculator.org/finance/cpi-calculator",
  "markdown": "https://www.acalculator.org/finance/cpi-calculator.md",
  "kind": "function",
  "method": "CPI = cost of the basket now ÷ cost in the base period × 100. Price change = (later CPI − earlier CPI) ÷ earlier CPI × 100. Amount at later prices = amount × later CPI ÷ earlier CPI. Average yearly rate = (CPI of the later year ÷ CPI of the earlier year)^(1 ÷ years between them) − 1, the same whichever year is typed first.",
  "assumptions": [
    "The basket holds the same goods and services in the same amounts in both periods; only prices change.",
    "Both CPI values use the same base, such as the CPI-U with 1982-84 = 100.",
    "The years are BLS CPI-U yearly averages (all items, US city average, not seasonally adjusted) from 1913 to 2025.",
    "Arithmetic is exact on the decimals you type; the CPI shows to 3 decimals, percents to 2 and money to the cent, halves up."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "from": {
        "title": "I know",
        "description": "The cost of a basket of goods in two periods, two CPI values, or two years to look up in the BLS CPI-U table.",
        "type": "string",
        "enum": [
          "basket",
          "index",
          "year"
        ]
      },
      "base": {
        "title": "Cost of the basket in the base period",
        "description": "What the basket of goods and services cost in the base period, which gets an index of 100.",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000000
      },
      "now": {
        "title": "Cost of the same basket now",
        "description": "What the same basket costs in the period you want the index for.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000000
      },
      "cpi1": {
        "title": "Earlier CPI",
        "description": "The index value in the earlier period, for example 112.5.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000000
      },
      "cpi2": {
        "title": "Later CPI",
        "description": "The index value in the later period, on the same base as the earlier one.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000000
      },
      "y1": {
        "title": "Start year",
        "description": "A year from 1913 to 2025: its BLS CPI-U yearly average is the earlier CPI.",
        "type": "integer",
        "minimum": 1913,
        "maximum": 2025
      },
      "y2": {
        "title": "End year",
        "description": "A year from 1913 to 2025: its BLS CPI-U yearly average is the later CPI.",
        "type": "integer",
        "minimum": 1913,
        "maximum": 2025
      },
      "amount": {
        "title": "Amount in the start period (optional)",
        "description": "A price or sum of money in the earlier period, to see what it equals at the later prices.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000000
      }
    }
  },
  "outputs": {
    "cpi": {
      "label": "Consumer price index (CPI)",
      "description": "Cost of the basket now ÷ cost in the base period × 100.",
      "format": "number"
    },
    "inflation": {
      "label": "Inflation (price change)",
      "description": "(Later CPI or cost − earlier) ÷ earlier × 100.",
      "format": "percent"
    },
    "value": {
      "label": "Amount at the later prices",
      "description": "The amount × later CPI ÷ earlier CPI.",
      "format": "money"
    },
    "startCpi": {
      "label": "CPI-U in the start year",
      "description": "The BLS yearly average, 1982-84 = 100.",
      "format": "number"
    },
    "endCpi": {
      "label": "CPI-U in the end year",
      "description": "The BLS yearly average, 1982-84 = 100.",
      "format": "number"
    },
    "yearly": {
      "label": "Average inflation a year",
      "description": "The yearly rate that compounds to the price change from the earlier year to the later one, whichever is typed first.",
      "format": "percent"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "from": "basket",
      "base": 107,
      "now": 117.5,
      "cpi1": 112.5,
      "cpi2": 121.5,
      "y1": 2000,
      "y2": 2025,
      "amount": 100
    },
    "outputs": {
      "cpi": 109.81308411214954,
      "inflation": 9.813084112149532
    },
    "text": "The price change between the two periods is 9.81%."
  },
  "examples": [
    {
      "given": {
        "from": "basket",
        "base": 107,
        "now": 117.5
      },
      "expect": {
        "cpi": 109.81308411214954,
        "inflation": 9.813084112149532
      },
      "source": "OpenStax, Principles of Macroeconomics 3e, 9.1 Tracking Inflation, Tables 9.2 and 9.3 (a basket costs $100, $106.50, $107 and $117.50 in four periods; with period 3 as the base year, index = spending ÷ 107 × 100: 93.4, 99.5, 100, 109.8; inflation from period 1 to 2 is 6.5%). https://openstax.org/books/principles-macroeconomics-3e/pages/9-1-tracking-inflation; hand calculation in content.mdx: 117.50 ÷ 107 × 100 = 109.813… (OpenStax shows 109.8)"
    },
    {
      "given": {
        "from": "basket",
        "base": 100,
        "now": 106.5
      },
      "expect": {
        "cpi": 106.5,
        "inflation": 6.5
      },
      "source": "OpenStax, Principles of Macroeconomics 3e, 9.1 Tracking Inflation, Tables 9.2 and 9.3 (a basket costs $100, $106.50, $107 and $117.50 in four periods; with period 3 as the base year, index = spending ÷ 107 × 100: 93.4, 99.5, 100, 109.8; inflation from period 1 to 2 is 6.5%). https://openstax.org/books/principles-macroeconomics-3e/pages/9-1-tracking-inflation; hand calculation in content.mdx: 106.50 ÷ 100 × 100 = 106.5, a 6.5% rise"
    },
    {
      "given": {
        "from": "index",
        "cpi1": 112.5,
        "cpi2": 121.5
      },
      "expect": {
        "inflation": 8
      },
      "source": "U.S. Bureau of Labor Statistics, Consumer Price Index Frequently Asked Questions (percent change = change in index points ÷ starting index × 100: Item A 112.500 to 121.500 is 8.0%, Item C 110.000 to 128.000 is 16.4%). https://www.bls.gov/cpi/questions-and-answers.htm: 9.0 ÷ 112.500 × 100 = 8.0"
    },
    {
      "given": {
        "from": "index",
        "cpi1": 110,
        "cpi2": 128,
        "amount": 100
      },
      "expect": {
        "inflation": 16.363636363636363,
        "value": 116.36363636363636
      },
      "source": "U.S. Bureau of Labor Statistics, Consumer Price Index Frequently Asked Questions (percent change = change in index points ÷ starting index × 100: Item A 112.500 to 121.500 is 8.0%, Item C 110.000 to 128.000 is 16.4%). https://www.bls.gov/cpi/questions-and-answers.htm: 18.0 ÷ 110.000 × 100 = 16.4 (exact 16.3636…); hand calculation in content.mdx: 100 × 128 ÷ 110 = 116.36"
    },
    {
      "given": {
        "from": "year",
        "y1": 2000,
        "y2": 2025,
        "amount": 100
      },
      "expect": {
        "startCpi": 172.2,
        "endCpi": 321.943,
        "inflation": 86.95876887340302,
        "value": 186.95876887340302,
        "yearly": 2.5344564685592097
      },
      "source": "U.S. Bureau of Labor Statistics, CPI-U, US city average, all items, 1982-84=100, series CUUR0000SA0, yearly averages (2000: 172.2; 2025: 321.943; 1913: 9.9). https://data.bls.gov/timeseries/CUUR0000SA0; hand calculation in content.mdx: 100 × 321.943 ÷ 172.2 = 186.96; (321.943 ÷ 172.2)^(1/25) − 1 = 2.53% a year"
    },
    {
      "given": {
        "from": "year",
        "y1": 2025,
        "y2": 2000,
        "amount": 1000
      },
      "expect": {
        "inflation": -46.51227080570163,
        "value": 534.8772919429837,
        "yearly": 2.5344564685592097
      },
      "source": "U.S. Bureau of Labor Statistics, CPI-U, US city average, all items, 1982-84=100, series CUUR0000SA0, yearly averages (2000: 172.2; 2025: 321.943; 1913: 9.9). https://data.bls.gov/timeseries/CUUR0000SA0; hand calculation in content.mdx: 1,000 × 172.2 ÷ 321.943 = 534.88"
    },
    {
      "given": {
        "from": "year",
        "y1": 1913,
        "y2": 2025,
        "amount": 1
      },
      "expect": {
        "value": 32.51949494949495,
        "yearly": 3.1576128972008455
      },
      "source": "U.S. Bureau of Labor Statistics, CPI-U, US city average, all items, 1982-84=100, series CUUR0000SA0, yearly averages (2000: 172.2; 2025: 321.943; 1913: 9.9). https://data.bls.gov/timeseries/CUUR0000SA0; hand calculation in content.mdx: 1 × 321.943 ÷ 9.9 = 32.52"
    }
  ],
  "sources": [
    "OpenStax, Principles of Macroeconomics 3e, 9.1 Tracking Inflation: a basket of goods priced in four periods ($100, $106.50, $107 and $117.50), index numbers with period 3 as the base year (93.4, 99.5, 100.0 and 109.8), and percentage change = (level in new year − level in previous year) ÷ level in previous year. https://openstax.org/books/principles-macroeconomics-3e/pages/9-1-tracking-inflation (retrieved 2026-10-19)",
    "U.S. Bureau of Labor Statistics, Consumer Price Index Frequently Asked Questions: most CPI series have a 1982-84 = 100 reference base, an index of 110 means a 10% increase since the reference period, and percent change = change in index points ÷ starting index × 100 (Items A, B and C). https://www.bls.gov/cpi/questions-and-answers.htm (retrieved 2026-10-19)",
    "U.S. Bureau of Labor Statistics, Handbook of Methods, Consumer Price Index: Calculation: the CPI measures the average change over time in the prices paid by consumers for a representative basket; yearly average indexes use 12 successive months of CPI values. https://www.bls.gov/opub/hom/cpi/calculation.htm (retrieved 2026-10-19)",
    "U.S. Bureau of Labor Statistics, CPI for All Urban Consumers (CPI-U), series CUUR0000SA0, U.S. city average, all items, not seasonally adjusted, 1982-84=100, yearly averages 1913 to 2025 (October 2025 not collected during the 2025 lapse in appropriations). https://data.bls.gov/timeseries/CUUR0000SA0 (retrieved 2026-10-19)",
    "U.S. Bureau of Labor Statistics, Schedule of Releases for the Consumer Price Index: the December 2026 CPI, with the 2026 yearly average, comes out on January 13, 2027. https://www.bls.gov/schedule/news_release/cpi.htm (retrieved 2026-10-19)"
  ],
  "related": [
    "inflation",
    "cola",
    "gdp-deflator",
    "real-interest-rate"
  ],
  "changelog": []
}
