These inflation winners are beating the market again this year and have potential upside

David Cordani President and CEO of Cigna, speaking at the CNBC Healthy Returns conference in New York on May 21, 2019.
Astrid Stawiarz | CNBC

Certain stocks have a history of thriving amid rising inflation — and they're beating the market again this year.

Investors are monitoring key inflation data as it can raise costs for companies and shrink the real value of investment returns. But it's not always a bad thing for the stock market, especially certain companies that have the power to raise prices. A key inflation indicator, the core personal consumption expenditures index, rose 3.1% in April from a year earlier, faster than the forecasted 2.9% increase.

Data from two recent inflationary periods provides insight into which companies weathered higher prices in the past. Bank of America identified November 2003 to September 2006 and October 2010 to January 2012 as the two most recent intervals of significant inflation. Despite the rising inflation, the S&P 500 still managed annualized returns of about 9% during each of those periods, according to BofA.

CNBC Pro found the stocks that beat the market during those two inflationary time frames — and then screened for which of those names are outperforming again in 2021. These names come from both the S&P 500 and the S&P MidCap 400 Index. From that list, we screened for the stocks that have buy recommendations from more than 70% of analysts and have at least a 10% upside to their average 12-month price target.

So we ended up with a list of past inflation winners that are outperforming the market this year and analysts believe can run even higher. Take a look CNBC Pro's list of inflation winners: