In the last several months inflation has popped up above 3% for the first time in 25 years, according to the Bureau of Labor Statistics. This might make investors nervous and have them asking how inflation might affect their stock portfolio. On a Fool Live episode recorded on June 17, Fool contributors Matthew Frankel, Brian Feroldi, and Brian Withers discuss the statistics on stock performance during inflation and how they are thinking about their portfolios today.

10 stocks we like better than Walmart
When our award-winning analyst team has an investing tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.*

They just revealed what they believe are the ten best stocks for investors to buy right now… and Walmart wasn't one of them! That's right -- they think these 10 stocks are even better buys.

See the 10 stocks

Stock Advisor returns as of 6/15/21

Matt Frankel: The question on investors' minds, why are we talking about it is how do stocks perform during inflationary periods? The general rule is they perform worse. That's not a very scientific answer. But in general, growth stocks do really bad during inflationary periods. Value stocks do really well relatively during inflationary periods. But let me just give you one statistic before we get into this.

From 1973 through last December, during periods where inflation was below 3%, stocks produced positive real returns meaning adjusted for inflation 90% of the time. If you look at periods when inflation was above 3% since 1973, that outperformance falls to 48% of 12-month periods. It's pretty clear that stocks do worse during inflation.

That's to be expected, because people are willing to pay less of a premium for earnings. It costs generally more to produce goods during inflationary periods of time. How confident do you feel about your portfolios in an inflationary period? From one value investor to two growth investors.

Brian Feroldi: Depends on the timeframe. Over the short term, I don't know. Over the long term, I feel great. To me, when inflation came up, it depends on really the magnitude and the duration of it. If it was double-digit inflation for years and years and years, that would probably not be great for [laughs] many of the stocks that I own. If it was modest inflation over a couple of years, I think that many of them would have short-term hits and short-term underperformance, but long term, I think that they will do fine.

Brian Withers: Yeah. My portfolio is geared toward a couple of different things. E-commerce, which people are just starting to adopt and realize there's an inherent value there. Certainly, I think last-mile delivery and gas and the fulfillment infrastructure and stuff is going to go up. But I think that convenience factor for e-commerce outweighs and may have shoppers willing to pay more for that convenience.

The other piece [of my portfolio] is software as a service, typically business-to-business companies, and that's one of the companies I'm talking about today, it's the same deal. These are going to provide inherent value efficiencies. It's going to enable businesses to fight costs versus cost them more money. As well, software companies don't have to deal with supply chain, last-mile delivery, those things. Computing costs have been incredibly -- You look at what $1,000 bought you 10 years ago versus what it buys you today for technology that you can hold in your hand. It's pretty amazing the difference there.

Frankel: I would actually call technology in a way, one of the most deflationary industries in the market. Look at where you could buy a TV for at Best Buy this year and what it costs last year for the same type of technology.

Withers: That's amazing.

Feroldi: Larry Page said the internet is the most deflationary invention in the history of mankind. Makes sense.

Frankel: Business-wise, it's deflationary.