The Consumer Price Index (CPI) is one of the most vital economic indicators used to measure inflation. It represents the aggregate price level of a market basket of consumer goods and services purchased by households. When the CPI rises, it indicates that the average price of goods is increasing, which is known as inflation.
This CPI Rate of Inflation Calculator helps you determine the percentage change in prices between two different time periods using their respective Index values. It allows economists, students, and consumers to understand how the purchasing power of money has changed over time.
How to Calculate Inflation Using CPI
Calculating the inflation rate between two periods is a straightforward process if you have the CPI values for both the starting period (base period) and the ending period (current period). The formula used measures the percentage growth from the starting index to the ending index.
Initial CPI Value: This is the index number established by the Bureau of Labor Statistics (or relevant government body) for the starting date of your comparison.
Final CPI Value: This is the index number for the ending date of your comparison.
Initial Item Price: (Optional) Entering a dollar amount here allows you to see what a specific item costing X amount in the past would cost today, adjusted for inflation.
Example Calculation
Let's say you want to calculate the total inflation between 1990 and 2020. Suppose the CPI for 1990 was 130.7 and the CPI for 2020 was 258.8.
1. Find the difference: 258.8 – 130.7 = 128.1
2. Divide by the initial CPI: 128.1 / 130.7 = 0.9801
3. Multiply by 100: 0.9801 * 100 = 98.01%
This means prices increased by approximately 98% over that 30-year period. If an item cost $10.00 in 1990, it would cost roughly $19.80 in 2020 purely based on CPI adjustment.
CPI and Purchasing Power
Inflation is inversely related to purchasing power. As the CPI increases, the value of a single unit of currency decreases because it buys fewer goods. This calculator also provides the "Purchasing Power Change," which illustrates how much value your currency has lost (or gained, in the rare case of deflation) relative to the initial period.
Why Do CPI Values Differ?
CPI values vary based on geography (e.g., US City Average vs. specific regions) and the specific index type (e.g., CPI-U for all urban consumers vs. CPI-W for wage earners). To get an accurate inflation rate, ensure you are using CPI values from the same specific data series for both your initial and final inputs.
function calculateInflation() {
var initialCPI = document.getElementById("initialCPI").value;
var finalCPI = document.getElementById("finalCPI").value;
var initialPrice = document.getElementById("initialPrice").value;
var errorMsg = document.getElementById("error-msg");
var resultArea = document.getElementById("result-area");
var priceRow = document.getElementById("price-row");
// Validate inputs
if (initialCPI === "" || finalCPI === "" || isNaN(initialCPI) || isNaN(finalCPI)) {
errorMsg.style.display = "block";
resultArea.style.display = "none";
return;
}
var startVal = parseFloat(initialCPI);
var endVal = parseFloat(finalCPI);
if (startVal <= 0 || endVal < 0) {
errorMsg.innerHTML = "CPI values must be greater than zero (Start) and non-negative (End).";
errorMsg.style.display = "block";
resultArea.style.display = "none";
return;
}
errorMsg.style.display = "none";
// Calculation Logic
// Inflation Rate Formula: ((End – Start) / Start) * 100
var inflationRate = ((endVal – startVal) / startVal) * 100;
// CPI Difference
var cpiDifference = endVal – startVal;
// Purchasing Power Change Formula: (Start / End) * 100 – 100
// Or simply how much the money is worth now compared to then.
// Often expressed as 1 / (1 + rate).
// Here we calculate the % change in value of currency.
// If inflation is 100%, purchasing power drops by 50%.
var purchasingPower = ((startVal / endVal) * 100) – 100;
// Update DOM
document.getElementById("inflationResult").innerHTML = inflationRate.toFixed(2) + "%";
document.getElementById("cpiDiff").innerHTML = cpiDifference.toFixed(2);
document.getElementById("powerResult").innerHTML = purchasingPower.toFixed(2) + "%";
// Handle Price Calculation if provided
if (initialPrice !== "" && !isNaN(initialPrice)) {
var startPriceVal = parseFloat(initialPrice);
// New Price = Old Price * (End CPI / Start CPI)
var newPrice = startPriceVal * (endVal / startVal);
document.getElementById("finalPriceResult").innerHTML = "$" + newPrice.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
priceRow.style.display = "flex";
} else {
priceRow.style.display = "none";
}
resultArea.style.display = "block";
}
function clearFields() {
document.getElementById("initialCPI").value = "";
document.getElementById("finalCPI").value = "";
document.getElementById("initialPrice").value = "";
document.getElementById("result-area").style.display = "none";
document.getElementById("error-msg").style.display = "none";
}