Many of us have unknowingly made the mistake of storing our nuts in the pantry.

Nuts are one of our favorite healthy snacks, as they are both convenient and loaded with health benefits. Nuts are a great source of heart-healthy fat, plant protein, fiber and a host of essential vitamins and minerals we often miss out on in our daily diets. The only downside is that they can be pretty expensive.

We typically reach for raw nuts, as we prefer to salt or flavor them ourselves (pre-salted or flavored nuts can loaded with sodium and sugar), but that makes them even more pricey. Luckily, we can turn to places like Costco to get almonds, cashews or other nuts for a low price—that just often means buying in bulk.

While nuts are shelf-stable, they contain those all-important unsaturated fats, which cause them to spoil if they aren't stored properly. Exposure to heat, light, oxygen and humidity can all make your nuts go rancid before you've gone through half the bag. Luckily, there's a much better option.

Storing your nuts in the freezer is the best way to ensure your omega-3-packed walnuts give you all the heart- and brain-health benefits they are supposed to. While nuts can last up to six months in the fridge, freezing them gives you a whole year to go through a giant bag. And because nuts are full of good-for-you oils, they are a lot less susceptible to freezer burn than your favorite tub of ice cream. You can always keep a small jar in the pantry for easy access and slowly refill from your freezer every two weeks or so, if that makes things easier.

There are two exceptions to the rule, however: coconut shreds and chestnuts should not be stored in the freezer because they both have a higher moisture content than tree nuts and peanuts. They can handle up to two weeks in the fridge.