Instead of relying on imprecise sell-by dates, here’s the best way to tell whether food like eggs, cheese, fish, or veggies have gone bad, according to science.

The best way to tell whether a food is still good to eat isn’t necessarily by looking at the sell-by date printed on the package.

Expiration dates are based on rough estimates. They can tell you when a carton of eggs or a raw steak will most likely reach the limit for its best quality, but that’s about it, according to research compiled by the Natural Resources Defense Council, a nonprofit environmental organization.

“Millions of Americans are tossing perfectly good food in the trash because they think it’s not safe to eat after the date on the package,” Dana Gunders, a senior scientist with the National Resources Defense Council, said in a statement last year.

Americans throw away up to 40% of purchased food every year, the equivalent of $218 billion. In addition to the wasted money – about $1,500 a year for a family of four, according to the NRDC – food waste also wastes the resources that were used to grow, store, and transport the food.

Fresh vegetables turn yellow when they’re going bad.

That said, some vegetables can still be salvageable, according to the Greater Chicago Food Depository. They suggest trimming the discolored portion of veggies like celery and soaking it for 10 to 15 minutes in ice water to refresh.

Bad bread grows mold.

That’s because bread is porous, meaning mold spreads easily throughout the loaf.

Bread that gets stale, hard, or dry, on the other hand, isn’t necessarily expired. Mold requires moisture to grow, so dry bread may still be perfectly fine to eat. It can typically be safely used to make bread crumbs or croutons.

If mold grows on soft cheeses like cottage or cream cheese, they should be discarded, according to the Mayo Clinic. That’s also true for shredded or sliced cheese.

Harder cheeses, however, take longer to spoil because of their density. In many cases, it’s possible to cut off a moldy outer layer and find the interior to be fine, since mold doesn’t penetrate far into harder cheeses like cheddar or parmesan.