Onions are a staple in most kitchens because their natural sugar lends tons of flavor to so many recipes. They generally store well whether you refrigerate them or not. But once part of it has gone bad, do you need to throw the whole thing away?

Is the Whole Onion Bad?

Not necessarily. Onions are a vegetable, and vegetables are made of separated cells, which means that if one group of cells turns bad, the entire vegetable shouldn’t be affected. By removing the affected cells, you can keep the healthy part of the onion. This is different than meat or dairy, in which bacteria infiltrates the entire product and not just a section of it.

What’s Up With the Mushy Part?

When organic material decays, it putrefies. Bacteria consumes the vegetable, and in the digestive process, enzymes are released and convert the solids into liquids, while releasing gases that smell bad. Basically, the mushy part is the result of the onion being “digested” by the invading bacteria.

Which Part Is Good?

Identifying the good part of the onion is critical before trying to salvage it. A healthy onion has firm skin and “meat,” and maintains the original color—red, white, or yellow. The outer part of the onion is covered with a thin, dry skin that flakes and tears easily. An onion should be dry unless it’s cut, and the juice running from a fresh-cut onion should be clear, smell strong, but not unpleasant, and definitely should not smell rotten.

Salvage the Good

Once you’ve determined where the good part of the onion is, it’s time for surgery. Get out a clean, sharp knife and cut away all the mushy part of the onion, and a good portion around it to make sure all contaminated material has been removed. There should be no question of freshness.