Millions of American families are having trouble making ends meet amid the highest consumer prices in 40 years.

Many are turning to “expired” or “expiring” food to save a few bucks.

And this isn’t a bad thing.

ReFED, a nonprofit organization, estimates that about 35% of the 229 million tons of food available is wasted annually by consumers.

The reason is often the “best by” and “sell by” dates on packages. Many people interpret that to mean food is no good after the appointed date.

In fact, “best by” and “sell by” dates typically mark a product’s peak freshness. That is, once the date passes, the food isn’t spoiled. It’s just not as fresh.

And it’s not just a U.S. problem. The United Nations estimates that the world wastes more than 1 billion tons of food every year.

That’s 17% of total food available to consumers as of 2019 — enough food, if packed into millions of trucks, to circle the Earth seven times.

Shoppers are discovering they can pocket significant discounts by turning to specialty retailers, such as Continental Sales, that focus on past-sell-by products.

And here’s a tip for restaurants and caterers: You’re protected by so-called Good Samaritan Laws if you donate leftover food to homeless shelters or food pantries.

California’s Integrated Waste Management Board estimates about 1.5 million tons of food is thrown out each year by restaurants and caterers.

Food waste is a serious problem. So is high inflation.

Savvy shoppers can help solve both.