It’s late at night, you just finished your homework, and all you want to do is go to bed, but you can’t get chocolate out of your mind. “Why does this always happen to me?” you ask yourself mid-bite of your favorite milk chocolate bar. Well, rest assured, because science has your answer – and not just for your late night chocolate cravings.

Science explains that cravings are not quite the same as hunger. Hunger is a survival mechanism controlled by the stomach while cravings are actually your brain signaling a mild malnutrition to you. As a result, we end up craving the vitamins and especially minerals that we lack. The good news is we can control our cravings (thank god), so let’s see how that works:

When you’re craving: Chocolate

cravings

Photo by Jared Sebby

What your body really needs is: Magnesium

Your conscious mind desires chocolate because of its high concentration of magnesium. This mineral is needed for more than 300 biochemical reactions in the body, including reactions that relate to relaxation.

So just hurry and get some nuts, seeds, veggies, or fruits in you before that whole chocolate bar is gone. Or, if you’re a chocoholic like me, just opt for 70 percent cocoa or higher dark chocolate, because according to this article, dark chocolate can do way more than just curb your cravings.

When you’re craving: Salty Foods

cravings

Photo by Rozina Yonyo

What your body really needs is: Chloride

Chloride and potassium, both components of sodium, are important electrolytes. So naturally, when you lack these (maybe after your sweat sesh at the gym or an intense episode of “The Bachelor”) you want those salty chips, and you want them bad.

But you got this. Confidently put that bag of pretzels down, and whip out some celery, tomato, fish, lettuce, olives or seaweed snacks and BOOM. You’ve found yourself some self-control.

When you’re craving: Sweets

cravings

Photo by Kelda Baljon

What your body really needs is:

Chromium

This mineral helps to regulate blood sugar levels, and therefore, a chromium deficiency fuels your desire for sugary foods. Cue “aha” moment.

But rest assured – there’s a healthier cure. Broccoli, cheese, grapes and chicken will curb your candy cravings, that is, if you’re trying to get rid of them. PSA: don’t bring broccoli to the movies. Candy IS encouraged in that situation (personal foodie tip: sour patch watermelon are the way to go).

Carbon

Carbon is one of the elements from which sugar is made, so without carbon, your body’s glucose levels are out of whack – hence, your strong urge to get sugar in your mouth NOW.

So just take a deep breath and get nommin’ on those fresh fruits to get this important mineral and spare the sugar crash later. Or if you’re really feeling fancy, you could make this bomb fruit salad recipe.

cravings

Photo by Becky Hughes

Phosphorus

This mineral helps your body produce energy, explaining why after a long day, your tired hand reaches for the ever-so-satisfying and conveniently-placed bowl of candy.

But will that bowl really cure your craving? Unfortunately, no. Instead, load up on chicken, beef, fatty fish, eggs, dairy, nuts, veggies, grains, and you won’t be eyeing those skittles no more.

Sulfur

Sulfur has an important role in removing toxins, but ironically, this deficiency leaves you reaching for the toxin-filled processed candy…

No worries. Just eat some cranberries, horseradish, cabbage, or cauliflower (not all in one for the sake of your personal sanity), and if you’ve got 10 minutes, you could show off and make this low carb cauliflower rice. Just pretend it’s fried rice, and if that doesn’t work say “spring break body” over and over until you’re convinced.

Tryptophan

I know what you’re thinking: “Whoa there, science. English please.” In normal words, tryptophan is a serotonin regulator important in maintaining your mood. A deficiency can leave you feeling low, thinking sweets will fix all your problems.

However, while sweets may not succeed, cheese, raisins, sweet potatoes, and spinach should do the trick (warning: this fix depends on the severity of your problem. Spinach doesn’t have the power to make your boyfriend come back, but this spinach and artichoke grilled cheese can help).

When you’re craving: Carbs

cravings

Photo by Christin Urso

What your body really needs is: Nitrogen

This is a hard one. I mean, there are even scientific reasons why carbs make you happy, like that fresh bread on the dinner table or the bag of pretzels accompanying your Grey’s binge-watching session. But because nitrogen is an essential component of nucleic acids and proteins, unfortunately, bread is not your cure here.

Eat some high-protein foods like meat, fatty fish, nuts, beans or even these quick-and-easy homemade protein balls, and that mindless craving will disappear.

When you’re craving: Fatty Foods

cravings

Photo by Chelsea Hawk

What your body really needs is: Calcium

Your deficiency in this bone-building mineral leaves you reaching for those fries because fats are necessary to help maintain bone density and keep calcium in the body.

But do yourself a favor, and go grab that greek yogurt. Or why not some green leafy vegetables? Everyone loves a good ol’ cheese stick. These are all easy fixes unless something fried is just what you really need after a long day; then by all means, go and treat yo’self.

So next time that chocolate bar or bag of chips is staring you down, don’t fret. You know what to do. Science has got your back.