The social contract of Halloween is simple: Provide adequate treats to costumed masses, or be prepared for late-night tricks from those dissatisfied with your offer. To help you avoid that type of vengeance, and to help you make good decisions at the supermarket this weekend, we wanted to figure out what Halloween candy people most prefer. So we devised an experiment: Pit dozens of fun-sized candy varietals against one another, and let the wisdom of the crowd decide which one was best.

While we don’t know who exactly voted, we do know this: 8,371 different IP addresses voted on about 269,000 randomly generated matchups. So, not a scientific survey or anything, but a good sample of what candy people like. And here’s what they said:

How often did a fun-sized candy of a given type win its matchups against the rest of the field? RK CANDY WIN PERCENTAGE 1 Reese’s Peanut Butter Cup 84.2% – 2 Reese’s Miniatures 81.9 – 3 Twix 81.6 – 4 Kit Kat 76.8 – 5 Snickers 76.7 – 6 Reese’s Pieces 73.4 – 7 Milky Way 73.1 – 8 Reese’s Stuffed With Pieces 72.9 – 9 Peanut Butter M&M’s 71.5 – 10 Butterfinger 70.7 – 11 Peanut M&M’s 69.5 – 12 3 Musketeers 67.6 – 13 Starburst 67.0 – 14 100 Grand 67.0 – 15 M&M’s 66.6 – 16 Crunch 66.5 – 17 Rolo 65.7 – 18 Milky Way Simply Caramel 64.4 – 19 Skittles original 63.1 – 20 Krackel 62.3 – 21 Milky Way Midnight 60.8 – 22 Sour Patch Kids 59.9 – 23 Snickers Crisper 59.5 – 24 Hershey’s Special Dark 59.2 – 25 Junior Mints 57.2 – 26 Haribo Gold-Bears 57.1 – 27 Baby Ruth 56.9 – 28 Hershey’s Milk Chocolate 56.5 – 29 Hershey’s Kisses 55.4 – 30 Nerds 55.4 – 31 Skittles Wild Berry 55.1 – 32 Milk Duds 55.1 – 33 Swedish Fish 54.9 – 34 Mr. Goodbar 54.5 – 35 Life Savers Big Ring Gummies 52.9 – 36 Sour Patch Tricksters 52.8 – 37 Air Heads 52.3 – 38 Haribo Sour Gold-Bears 51.4 – 39 Almond Joy 50.3 – 40 Tootsie Roll Snack Bars 49.7 – 41 Whoppers 49.5 – 42 Tootsie Pop 49.0 – 43 Mounds 47.8 – 44 Trolli Sour Bites 47.2 – 45 Gobstopper 46.8 – 46 Mike and Ike 46.4 – 47 Payday 46.3 – 48 One quarter (25 cents) coin 46.1 – 49 Smarties 46.0 – 50 Tootsie Roll Midgees 45.7 – 51 Twizzlers 45.5 – 52 Welch’s Fruit Snacks 44.4 – 53 Fruit Chews 43.1 – 54 Tootsie Roll Juniors 43.1 – 55 Runts 42.8 – 56 Dots 42.3 – 57 Haribo Twin Snakes 42.2 – 58 Werther’s Original Caramel 41.9 – 59 Laffy Taffy 41.4 – 60 Pop Rocks 41.3 – 61 Dum Dums 39.5 – 62 Now and Later 39.4 – 63 Fun Dip 39.2 – 64 Lemonhead 39.1 – 65 Warheads 39.0 – 66 Charleston Chew 39.0 – 67 Candy corn 38.0 – 68 Nestle Smarties 37.9 – 69 Pixy Stix 37.7 – 70 Red Vines 37.3 – 71 Chewy Lemonhead Fruit Mix 36.0 – 72 Ring Pop 35.3 – 73 Sixlets 34.7 – 74 Strawberry bon bons 34.6 – 75 Tootsie caramel apple pops 34.5 – 76 Haribo Happy Cola 34.2 – 77 Sugar Babies 33.4 – 78 One dime (10 cent) coin 32.3 – 79 Sugar Daddy 32.2 – 80 Root Beer Barrels 29.7 – 81 Jaw Busters 28.1 – 82 Super Bubble 27.3 – 83 Chiclets 24.5 – 84 Boston Baked Beans 23.4 – 85 Nik-L-Nip 22.4 – 86 Good & Plenty 21.9 –

Reese’s Peanut Butter Cups and their spinoffs come out huge here, taking four of the top 10 spots and appearing pretty synonymous with the platonic ideal of Halloween candy. The brand was the best-selling candy in the U.S. as of 2013, and market research showed it was the top snack-sized candy in Halloween times.

But what made some candies more desirable than others? Was it price? Maybe it was just sugar content? Nah, neither really. I pulled fun-sized portion sugar content from a series of dieting websites (FatSecret, MyFitnessPal), and in cases of particularly hard-to-find candies, I just went to the nearby drugstore. I pulled bulk prices from Candy Warehouse. After a spooooky regression with a truly hellish r-squared, there’s no evident link here between price, sugar and perceived quality.

So if it’s not price or sugar, there must be something about what’s in the candies that make some better and some worse. With the fervency of a stay-at-home dad who recently learned of a child’s mild peanut allergy, I scoured the internet for descriptive ingredient data about all the candies in our data set. Were they chocolate? Did they contain peanuts or almonds? How about crisped rice or other biscuit-esque component, like a Kit Kat or malted milk ball? Was it fruit flavored? Was it made of hard candy, like a lollipop or a strawberry bon bon? Was there nougat? What even is nougat? I know I like nougat, but I still have remotely no clue what the damn thing is.

With a full typology in hand and access to some of the most powerful statistical software available on the market, my questions were answered.

That’s a lot to take in! In general, here’s what this information says. According to the regression, about half the variance observed in the quality can be explained by these nine properties of candy, which isn’t great but also isn’t awful — and is thus enough for us to work with.

A Halloween candy that has none of those ingredient components would be expected, as a baseline, to win a matchup about 35 percent of the time. Sure enough, this bears out in our data: For giggles we also put in “one dime” and “one quarter” to see how desirable they were, and the dime — which is neither chocolaty, nor fruity, nor full of caramel, peanuts, wafers, et cetera — beat 32 percent of competitors, and the quarter beat 46 percent.

CANDY TYPE AVG. WIN SHARE VALUE ADD TO WIN % Chocolate 61% +19.9 Fruit 44 +10.3 Peanuts & nuts 57 +10.1 Crispy 64 +9.0 Caramel 60 +3.4 Nougat 66 +2.4 Multi-piece 41 -0.2 Candy bar 61 -0.7 Hard candy 47 -4.9

The table adjacent to this paragraph simplifies that “coef.” column. If a hypothetical candy had chocolate in it, we’d expect its win percentage to rise by about 20 points. If it’s fruity, we’d expect it to rise by 10. If it had nuts, we’d also expect its win percentage to rise by 10, with wafers or crisped rice rising by 9. And nougat and caramel don’t bring a ton to the table. A candy being hard — like a lollipop or jawbreaker — actually knocks about 5 points off its win percentage. Whether it’s in bar form or a bunch of little candies makes no major difference.

Note that a candy can be one or two or all of these things: A Snickers is a chocolate (+20), peanut (+10), caramel (+3), nougat (+2) candy that we’d expect to have in the ballpark of a 70 percent win rate, and it does in fact have a 77 percent win rate.

Which brings up an obvious question: Can we build the perfect Frankencandy based on this information?

On one hand, no, that’s a ridiculous oversimplification of a somewhat scientific process and is likely to result only in an abomination.

On the other hand, that exact ethical dilemma did not stop Dr. Frankenstein, and ’tis the season!

We’ve got to have chocolate — the win percentage of contenders containing chocolate was about 11 points higher than the average contender and 19 points higher than contenders that did not have chocolate. The same goes for both crispiness and nuttiness: Entrants with peanuts or almonds had win percentages about 13 points higher than the average contender, and ones with crispy wafers or puffed rice were nearly 16 points higher than average. Nougat and caramel are net positives for sure, so throw them in.

Now we get to some major qualitative components. Candies in bar form generally had a higher overall win rate than those in pieces, so we’ll want a bar. Yes, fruitiness can be fine, but things that had a fruity taste had a win percentage 11 points lower than those that did not. This is due to the near mutual exclusivity of fruity flavors and chocolate, with Tootsie Pops being the sole exception.

So, in the end, the best Frankencandy has the chocolate of a Hershey bar, the nougat of a Baby Ruth, the caramel of a Milky Way, the peanut butter of a Reese’s Cup and the wafer of a Twix, and it’s assembled in a castle looming over an Eastern European village. Or if you’re trying to make this at home: Maybe take a Twix bar and smush it on a PayDay, or roll a Snickers around in rice crispies.

Call me what you will — the modern Prometheus, a contemporary, pre-diabetic Frankenstein — but I think I have the next big idea in Halloween candy. So what I’m trying to say is, yes, Mr. Wonka, I am available to consult if you’re interested in entering the abomination business.