The Consumer Price Index (CPI) measures the price of a “basket” of goods and services that are deemed to be necessary to average consumers in a country. By measuring the price of this basket, the CPI is ultimately used to measure inflation.
The CPI attempts to measure the overall cost of things that people need to buy. As we can see in the link below, it measures the costs of many things. For example, the CPI for the US includes such things as the prices of breakfast cereal, chicken, rent for housing, jewelry, gasoline, eyeglasses, sports equipment, computer software and funerals. These things represent a variety of things that people typically need to buy.
The CPI then takes the weighted total of these prices and compares it to the price in a “base year.” The index in the base year is set at 100 and the current year CPI is based on that. So, if the base year were 2010 and prices had gone up 10% since then, the current year CPI would be 110.
The CPI, then is used to measure the overall price of goods and services that people typically use. By doing this, it is typically used to measure inflation.