Those who’ve inadvertently kept a carton long past its expiration date (and smelled the result) know how crucial it is to prevent spoilage by storing eggs properly. To figure out how best to preserve almost-spoiled eggs, we spoke to Jesse Laflamme, the CEO (and third-generation egg farmer) of Pete and Gerry’s Organic Eggs. He told us the best way to preserve eggs long-term is to freeze them. Below are some egg-freezing tips that work for his family.

How to Freeze Eggs

“I grew up on a farm and joined a multi-generational line of egg farmers,” says Laflamme. “There’s probably little that needs to be said about the number of eggs we had in and around our kitchen, and that at times we had to employ some pretty clever storage tricks to minimize waste.” His top tip for keeping eggs fresh is quite surprising: Freeze them. “It takes a little finessing, but you can freeze both egg whites and egg yolks.” Here’s how he does it.

Select Quality Free-Range Eggs

For starters, make sure you purchase the right type of egg to freeze. “Temperature can impact your ability to digest eggs and benefit from the wealth of nutrients they offer (B and C vitamins, choline, omega-3 fatty acids, and antioxidants),” he says. “So it’s important to purchase high-quality eggs that can withstand the stress of extreme temperatures. Our hens have more time to roam and forage outdoors on grass than cage-free hens, which often have no outdoor access.”

Add Salt or Sugar to Egg Yolks Before Freezing

According to Laflamme, the right technique will enable you to freeze egg yolks for up to four months. Naturally, the freezing process can compromise the texture of egg yolks, making them much more difficult to cook. To prevent this, beat in either ⅛ teaspoon salt or 1½ teaspoon sugar for every four egg yolks (¼ cup). “Note which ingredient you introduced, so you can use them for appropriate dishes,” he says. “Accidentally using salted egg yolks for your homemade birthday cake just isn’t the same!” And always write the freeze date on your storage container. When cooking with frozen egg yolks, thaw them first by running them under cold water. You can substitute 1 tablespoon of thawed yolk for one fresh yolk.

Store Liquid Egg Whites in Ice Cube Trays

Egg whites hold up better than egg yolks when frozen, lasting up to 12 months. That said, we recommend staying within a two-month window. Since the texture of the egg white isn’t changed much by freezing, there is no need to add salt or sugar prior to chilling. Try storing one dozen egg whites in an ice-cube tray, which allows for simple-to-remember portions and easy access. These can be brought to room temperature and then used for an array of baked desserts.

Top Whole Eggs With a Little Water Before Freezing

“You can also freeze whole eggs in a variety of ways but not inside the shell,” explains Laflamme. Under extremely low temperatures, the eggshell will crack. Remove the shell and freeze the contents as a whole, topped with a little water. (Or better yet, separate the yolk and whites and freeze them separately.)

Don’t Freeze Old De-Shelled Eggs

Never freeze liquid egg yolks or whites that have been outside the shell for more than two to four days. For optimal freshness, store de-shelled eggs in airtight containers for freezing within the first 48 hours.