masahiro Makino/Getty Images

Those farm-fresh eggs can be preserved for up to a year—but only if you do so correctly.

Ever end up with more eggs than you know what to do with? Maybe you accidentally over-purchased for a recipe or group of visitors, or maybe you have your own chickens that are happily laying eggs faster than you can eat them. While eggs will last in the refrigerator for a few weeks, there are certain times when you need to keep them fresh for longer. The best way to preserve eggs is to freeze them, which might seem like a strange idea if you’ve never done it, but when done correctly, can keep your farm- (or just grocery store-) fresh eggs usable for months.

There are several ways to freeze raw eggs correctly, but there’s one that is always going to be wrong: freezing them in their shells. The shells will expand and crack as soon as they freeze. So once you remove the eggs from their shells, how should you go about freezing them? You can freeze whole eggs together, or you can separate the whites and yolks before you freeze. Here’s how:

Whole Eggs:

There are a couple ways to prep whole eggs for freezing, and you should choose the method that makes most sense for how you think you’ll use the eggs down the road.  If you typically need just one egg at a time, you can use an ice cube tray or egg container to freeze individual, whole eggs. Just crack an egg into each section, cover, and freeze. Once the eggs are frozen through, you can pop them out and transfer to a larger Tupperware container or freezer-safe storage bag. Whenever you need one or two eggs, you can easily grab the amount you need while keeping the others frozen.

If you typically use two or more eggs at a time for baking or cooking, you can freeze several eggs together in one container. Crack whatever number of eggs you want to store together into the container and then gently beat them just to the point of yolk and white being mixed. You don’t want to add in any extra air by whisking too much. Because yolks can get a bit gelatinous when they freeze—which can make for an undesirable texture when you thaw them—it helps to add a bit of salt or sugar to the mixture before freezing. Depending on your future intentions with the eggs (baking or cooking), add ½ teaspoon of salt or sugar for every cup of eggs. Be sure to label your container with the number of eggs and any salt or sugar additions so you can adjust your recipe if necessary.

WATCH: 5 Items You Should Buy in Bulk

Separate Egg Whites and Yolks:

You can easily separate egg whites and yolks before freezing if you tend to use one or the other for your recipes. Whites can be separated into ice cube trays and frozen individually without any special attention. For yolks, you’ll want to add salt or sugar as described above. Mix in the salt or sugar to a bowl of yolks, then put 1 tablespoon of the mixture into each section of a container to freeze (equals one yolk).

To use frozen eggs, let them thaw in the refrigerator overnight, or run them under cold water. You’ll want to use yolks and whole eggs immediately after thawing. Whites may beat better if you let them sit at room temperature for 30 minutes or so.