Good oil will last about a year after opening, but lower-quality oil will only last a few months.

If you're skeptical that your oil is still good, it's best to toss it.

That oil that's been sitting forgotten in the back of your tallest cabinet may look as pristine as it did when you bought it years ago, but is it actually safe to cook with?

Oil is one of those ingredients we may not think of as having an expiration date — add salt, flour, and those too-sweet rainbow popsicles in your freezer to the list — but like anything fresh, oil has won't last forever. So should you toss the bottle of olive oil that's old enough to enroll in kindergarten? Probably.

"Oil that is not opened and stored in a dry, cool place can last up to two years," R.L. King, chef, and owner of New York's Bar Gonzo told INSIDER. "Once you have opened the oil, it should be used in the first two to three months. However, a well produced and high-quality product could last up to one year, again stored in a dry cool place and lid tightly sealed."

Although those glass olive oil containers commonly seen on restaurant tables may be better looking than the bottle or tin your oil comes in, if they're made of clear glass, they're not helping extend your oil's shelf life.

Iurii Stepanov/Shutterstock

Should you really want to use a stylish canister, opt for a tinted or opaque container, and keep it small, so you're more quickly cycling through the open oil rather than letting a whole mass of it sit in the light. Extra virgin olive oil lasts the longest, but any oil has its limits. "Oil can and will expire, keep in mind it's a fresh-pressed fruit," King says.

How do you know if your oil has gone bad? "It may begin to turn and taste sour or strangely sharp," says Laurence Edelman, chef, and owner of New York's Left Bank. "But honestly, just use it up quickly and you don't have to worry about how long it lasts!"

Expired oil probably isn't going to kill you or make you sick, but for the most flavorful food, follow these chefs' advice, stop over-buying oil and just stock what you need when you need it. If you think your oil is rancid, always default to the food-safety adage: When in doubt, throw it out.

Sign up here to get INSIDER's favorite stories straight to your inbox.