Sometimes, the foil lid on a yogurt container will bulge at the top, even if you haven’t opened it and it isn’t past its expiration date.

Since you’re here, I take it this happened to a cup or two of yogurt in your fridge. Now, you’re wondering whether or not they’re safe to eat.

I found myself doing the same a few days ago when I opened my fridge, and it caught my attention that the lid on a seemingly good Greek yogurt container had all of a sudden puffed up.

There wasn’t much helpful information out there, so I set out to do some research and then wrote this post. So here’s everything you need to know on the topic of bulging yogurt.

Let’s start with the basics: yogurt is a fermented milk product.

It’s cultured with living bacteria that can survive refrigerator temperature and which feed on the carbohydrates contained in it long after it’s made, packaged, and sold.

Don’t worry; these bacteria are generally harmless. They’re called probiotics, and, as quite a few studies over time have shown, they’re good for you in more than one way. Most containers of yogurt also have many other bacterial cultures, active to a varying extent.

More often than not, a puffed-up lid on your yogurt container is a sign of bacterial activity. It’s also a timely reminder that it’s about to go off sooner rather than later.

Plain yogurt is made by heating raw milk to a temperature of 185°F, which helps to denature the milk protein (called “casein”) and keeps it from curdling.

Next, the milk is cultured with Streptococcus thermophiles (S. thermophiles) or Lactobacillus bulgaricus (L. bulgaricus) bacteria and left out at a temperature of 113°F for 4 to 12 hours.

At this temperature, the bacteria multiply aptly and feed on the sugars (called “lactose”) in the milk, producing greater and greater quantities of lactic acid, diacetyl, butyric acid, and alcohol as byproducts.

The lactic acid reacts to the casein in the milk, making it firm and giving it a tangy taste (hence the distinct thickness and tartness of yogurt). The rest of the byproducts also ameliorate the yogurt’s aroma and flavor.

However, yogurt bacteria are not capable of producing gas. So they can’t cause the lid on the yogurt container to bulge. When this happens, it’s probably a sign that the S. thermophiles or L. bulgaricus cultures are dying off and getting superseded by gas-producing bacteria.

Treat it as an alert that the yogurt is closer to spoiling than you probably think.

What’s the verdict, then? Is bulging plain yogurt safe to eat?

If it isn’t past its expiration date, shows no visible signs of spoiling, and doesn’t smell off in any way, it probably is.

Another and less-apparent reason why yogurt containers can bulge is altitude.

Yes, you read that right.

If you live at a high altitude and the yogurt container was sealed at a low altitude, the altitude difference can cause the lid on it to bulge.

“At high altitudes, the pressure inside the bag is still the same as sea level air pressure, but the air pressure outside the bag is lower,” explains a resident of Evergreen, Colorado, a town at 7,165 feet above the sea.

“This means that, overall, the air in the inside the bag pushes outward harder than the air on the outside of the bag pushes inward.”

If this is the case for you, then most tightly sealed items—be they yogurt containers, milk cartons, and bags of chips—will puff up.

On the other hand, flavored yogurt might bulge for reasons more concerning than probiotic activity or altitude differences and should be discarded.

If the yogurt is a fruit-on-the-bottom type, it may have been improperly refrigerated during transportation or at the store, according to Master of Science and Registered Dietitian Andrea Klausner, who expressed her view on the topic in the UC Berkeley Wellness Letter in response to a reader question.

Bulging flavored yogurt should be discarded, Klausner advises, “since you can’t really know what causes the swelling.”

In June of 1989, the United Kingdom had its largest recorded outbreak of food-borne botulism when an outbreak associated with contaminated hazelnut yogurt affected 27 people. Sadly, one person passed away.

So if you see puffed-up peel-off lids on flavored yogurt, it’s best to throw it in the bin, even if it isn’t past its expiry date.

Better safe than sorry.