Researchers asked 68 people to avoid food for five hours. They then served half of them crackers to eat until they felt satisfied. Finally, all of the participants shopped at an online grocery store. The result: The hungry shoppers chose more high-calorie foods than their just-fed counterparts. In a follow-up study, researchers tracked people’s food purchases in a brick-and-mortar grocery store at two different times: right after lunch, when they were most likely to be full, and right before dinnertime, when they were likely to be hungry. Interestingly, hunger didn’t significantly affect how many items the shoppers bought—but it did affect the kind of food they purchased. Hungry shoppers filled their carts with more high-calorie foods and fewer lower-calorie foods than the full shoppers. Previous research suggests that hunger makes your brain find high-calorie grub more appealing. One explanation: When you’re hungry, your body thinks food is scarce, says study co-author Aner Tal, PhD, a post-doctoral research associate at Cornell University’s Food and Brand Lab. You’re hard-wired to look for high-calorie foods to make up for this deficiency and prevent it in the future, he says. And while this makes sense for an animal in the wild, it’s not the smartest strategy for humans who have access to so much unhealthy food. It seems obvious, but the best way to prevent your instincts from taking over your shopping cart is to avoid grocery shopping when you’re hungry and stick to a premade grocery list. (Like this one or this one.) If you typically swing by the grocery store on your way home from work before dinner, pack a snack. And if you can’t eat before you shop, push your cart directly to the produce aisle to pick up (and pay for) an apple to take the edge off. Then steer clear of the foods that don’t deserve a place in your pantry. More from Prevention: The Best Ways To Prevent A Binge