This paper introduces a model where agents are unsure about the central bank's inflation target. They believe that the central bank's inflation target could lie between two extremes, and their beliefs vary depending on the central bank's stock of credibility. They form the expectations used in price and wage setting using this perceived inflation target, and they use past observations of inflation to update their beliefs about the credibility of the central bank. Thus a series of high inflation observations can lead them to believe (incorrectly) that the central bank has adopted a high target. High inflation expectations are incorporated into price and wage setting decisions, and a transitory shock to inflation can become very persistent. The model with endogenous credibility can match the volatility and persistence of both inflation and measures of long-term inflation expectations that we see in the data. The model is then calibrated to match the observed levels of Federal Reserve credibility in the 1980s and the 2000s. By simply changing the level of credibility, holding all else fixed, the model can explain nearly all of the observed changes in the volatility and persistence of inflation and inflation expectations in the U.S. from the 1980s to today.