Chocolate cravings around your period come from a mix of shifting hormones, a drop in serotonin, and a real dip in magnesium.
This is not a lack of willpower. In the days before your period, estrogen and progesterone fall, and that fall pulls serotonin, your mood regulating brain chemical, down with it.
Nearly half of women report craving chocolate specifically in the week leading up to their period and during it.
The craving is strong enough, and common enough, that researchers treat it as a recognized part of premenstrual syndrome, known as PMS, rather than a random habit.