There's more than one way to store onions, but there's only one best way.

It's always good to have a few onions on hand. They're one of the most useful culinary companions no matter what the season. That's why we buy them in bulk at the supermarket, stocking up on those big mesh bags bulging with onions of all kinds. But because their signs of spoilage aren't as obvious as some other vegetables, you may be keeping your onions well past their prime without even realizing it.

Learn exactly how to best store onions, and how long they will last depending on where you are keeping them.

How Long Do Whole Onions Last?

Different types of onions in basket on wooden background
Credit: Getty Images

Ideally, onions should be stored in a cool, dark place between 45 and 55 degrees F. Whole, raw onions will last two to three months when stored in a cool, dry place. Places that provide these conditions may include your cellar, pantry, unheated basement, or garage.

For many of us, it's a challenge to find a cool spot like this in our homes. If this is the case for you, you may be better off storing onions in the refrigerator for maximum shelf life. They will last at least two to three months in the refrigerator as well – just be mindful that their texture may get somewhat soft in the fridge as onions absorb moisture very easily.

That said, if you lack fridge space and storing onions at room temperature is your only option, whole, raw onions will last two to four weeks at room temperature.

When storing onions, whether at room temperature or cooler, be sure to provide proper ventilation to prevent mold. An open basket, mesh bag, or loosely covered paper bag will do the trick. Do not store onions in a plastic bag, as this will not allow for proper ventilation.

It is important to note that potatoes should be kept away from moisture-releasing foods, like potatoes, as well. If by chance you are holding onto an heirloom potato and onion bin and are now wondering if you should ditch it, check to make sure the compartments are separated and vented enough that the gases don't interact. If so, you can feel good about keeping it in the family. If not (and you start to see your onions or potatoes sprouting earlier than you think they should) consider updating your storage.

How to Store Peeled or Cut Onions?

Once an onion has been peeled, it is best stored in the fridge to avoid contamination. Halved, sliced, or chopped raw onions should also be refrigerated, in an airtight container or resealable plastic bag. They will last seven to 10 days when stored this way.

Cooked onions should be stored in an airtight container and refrigerated as well. Like most leftovers, cooked onions will last up to four days in the fridge.

Another bonus of refrigerating onions is that the cold slows down the enzymes responsible for those pesky onion tears.

How Long Do Onions Last in the Freezer?

Good news! You can freeze raw onions to extend their shelf-life. Start by peeling the onions, and then chop or slice as desired. Place them in an airtight container, freezer bag, or wrap them tightly in aluminum foil or plastic wrap. Raw onions will last up to eight months in the freezer.

Cooked onions can be frozen for up to 12 months when stored in an airtight container or freezer bag.

How to Tell if an Onion Is Bad or Spoiled

There are three ways to tell if your onions have gone bad: color, feel, and smell. Spoiled onions may develop dark spots, which will eventually begin to grow mold. You'll also want to avoid onions that have started sprouting, as this indicates they're beginning to go bad.

You can also feel your onions to check how fresh they are. Onions with soft or mushy spots are starting to go bad.

And finally, who could forget the sniff test? Naturally, onions will begin to change scent as they spoil. Of course, some of us don't find the scent of raw onion pleasant to begin with, so let's just say that if your onions begin to smell like anything other than onion, it's probably time to say out with the old and in with the new.