If you haven't yet stocked up on your Halloween candy, you're in luck. Turns out waiting until the last minute is the best strategy, according to experts.

Retailers tend to put candy and Halloween decor on sale closer to Oct. 31, so last-minute shoppers actually score good deals, Sara Skirboll, RetailMeNot.com's shopping and trends expert, tells CNBC Make It. "Stores are in such a hurry to put up holiday merchandise after Halloween, so they will have steep discounts to make sure all of the spooky decor and candy is off the shelves," she says.

Americans love their Halloween candy so much, sales this year are expected to top $2.6 billion, according to the National Retail Federation.

CNBC Make It crunched the numbers to get specific about what to buy and where to buy it, in order to get the best deals on Halloween candy. We reviewed the price per piece of over 40 types of the most popular snack-size and fun-size candy at three major retailers, Amazon, Target and Walmart.

Here's what we found:

Try Target. Of the three retailers we surveyed, Target had competitive prices on the widest selection of treats.

Of the three retailers we surveyed, Target had competitive prices on the widest selection of treats. Buy mixes. If you're looking for bargains, definitely take Skirboll's advice and reach for the assorted mixes, rather than trying to create a custom candy mix. We found that the assorted bags offering between 50 and 150 candies averaged $0.10 per piece, slightly less per piece than if you bought multiple types of candy separately.

If you're looking for bargains, definitely take Skirboll's advice and reach for the assorted mixes, rather than trying to create a custom candy mix. We found that the assorted bags offering between 50 and 150 candies averaged $0.10 per piece, slightly less per piece than if you bought multiple types of candy separately. Chocolate is more expensive. [Editor's note: Worth it.] Not all candy is created equal: Generally, chocolates cost a bit more than sugar-based treats like candy corn. "As for bang for your buck, candy corn is the obvious winner, but it's a risk because it's so controversial," says Clair Robins, spokeswoman for CandyStore.com. The Halloween treat ranked #6 on CandyStore's list of most popular candy, but it was the #2 most hated Halloween candy in in a recent survey as well.

Not all candy is created equal: Generally, chocolates cost a bit more than sugar-based treats like candy corn. "As for bang for your buck, candy corn is the obvious winner, but it's a risk because it's so controversial," says Clair Robins, spokeswoman for CandyStore.com. The Halloween treat ranked #6 on CandyStore's list of most popular candy, but it was the #2 most hated Halloween candy in in a recent survey as well. Buy in bulk. "When tackling the Halloween candy shopping list, remember to buy in bulk," Skirboll says, because buying a 100-piece bag is usually better than a deal on buying several smaller bags.

If you're looking to play it safe, stick with crowd-pleasers. Using CandyStore's sales data on the most popular candy, here are the most popular brands in the U.S. that will cost you the least.