It's 2 a.m. You've tried both sides, the pillow between the knees, and the thing where you press a fist into your stomach. The cramp does not care. Tomorrow starts in six hours whether you sleep or not.
We've all had that night. Here's what has actually helped us, and what the research says about each one.
Why period cramps at night feel worse
Honest answer first: nobody has shown that cramps are objectively stronger after dark. What the research does show is that sleep itself is at its worst around your period. A review in Sleep Medicine found that self-rated sleep quality is lowest around menstruation, even though the structure of sleep stays fairly stable. Add a quiet, dark room with nothing else to think about, and a cramp you'd shrug off at noon gets your full attention.
The cramps come from prostaglandins, which make the uterus contract to shed its lining. Most of what follows either blunts them or works around them.
1. Time the painkiller so it's working at bedtime
NSAIDs like ibuprofen and naproxen block prostaglandin production, and they do their best work when they're already in your system before the cramps build. Mayo Clinic suggests starting at regular doses the day before you expect your period and continuing for two to three days. For nights, that means taking the evening dose with dinner rather than reaching for it at 2 a.m., when you'll lie there waiting for it to kick in.
They earn their place. A Cochrane review of 80 trials found NSAIDs gave moderate or excellent relief to roughly 45 to 53% of women, against 18% on placebo. Stomach side effects are a little more common, which is one more reason to take it with food. Ask a pharmacist which one suits you and how late in the evening you can take it.
2. Heat that stays put while you sleep
A hot water bottle is lovely for twenty minutes and then it's a lukewarm lump under your back. Heat works, though. In a trial of 84 women, a low-level heated patch worn for about 12 hours gave as much relief as 400 mg of ibuprofen three times a day. For overnight, a stick-on patch or an electric pad with an automatic shut-off is safer than anything you can fall asleep on top of. We compared the options in heating pad vs hot water bottle vs patch.
3. On your side, pillow between the knees
No trial has tested sleeping positions for period pain, so this is experience, not evidence. Many people find that lying on their side with knees drawn up takes the strain off the lower belly, and a pillow between the knees stops the hips twisting. Flat on your stomach presses on the exact spot that hurts.
What did not work for us: the idea that you should lie on your back under a heavy blanket for "pressure". One of us tried it for a week and woke up with cramps plus a sore back. Back to the side.
4. Cut caffeine earlier than you think
Caffeine has a half-life of anywhere from two to ten hours depending on the person, according to Cleveland Clinic. So a 4 p.m. coffee can still be half at work at midnight for some people. During your period, when sleep is already fragile, a lunchtime cutoff is a small trade. Herbal tea or warm milk in the evening does the comforting part without the wake-up.
5. Magnesium, with a caveat
Magnesium comes up twice here. For sleep, one double-blind trial gave 500 mg a day for eight weeks and saw people fall asleep faster and sleep more efficiently. The caveat is large: it was 46 older adults with insomnia, not young women with cramps, so we can't promise it carries over. For the period side, a crossover trial of 200 mg a day found less bloating and fluid retention, but only in the second cycle, not the first. Food counts too: pumpkin seeds, spinach, black beans and dark chocolate. How much, when, and from what is in why dark chocolate helps period cramps.
6. Make the room cooler
In the second half of your cycle your body temperature runs slightly higher, and the same Sleep Medicine review notes that the normal night-time dip in temperature is smaller too. A warm room fights that. Drop the thermostat a degree or two, use a lighter blanket, and keep the heat local, on your stomach, rather than everywhere.
What we make, and why. We're a small team who has spent enough 2 a.m.s like this to make something for them: Girl Chocolate, a dark chocolate bar made for the days around your period, with magnesium and other functional ingredients, sold as a pouch of eight bars for one cycle. One square with your evening tea is the kind of small ritual that makes the night feel handled. Made for your cycle, and it supports PMS relief*.
The order we'd do it in
Evening dose with dinner. Patch on before you brush your teeth. Room a degree cooler. Side, pillow, lights out. If you're still awake at 2 a.m., get up, make the tea, and go back when you're actually sleepy. Lying there counting cramps is the one thing that never helped.

Print our free period cramp relief cheat sheet: the heat, ginger, magnesium and timing facts from this guide, all on one page. 1 page, PDF, no email needed.
Download the PDFSources
- Baker and Driver 2007, Circadian rhythms, sleep, and the menstrual cycle (Sleep Medicine)
- Mayo Clinic, Menstrual cramps: diagnosis and treatment
- Marjoribanks et al. 2015, Nonsteroidal anti-inflammatory drugs for dysmenorrhoea (Cochrane)
- Akin et al. 2001, Continuous low-level topical heat in the treatment of dysmenorrhea (Obstet Gynecol)
- Cleveland Clinic, Is it bad to drink coffee late at night?
- Abbasi et al. 2012, The effect of magnesium supplementation on primary insomnia in elderly (J Res Med Sci)
When to talk to a doctor
Everything above is for ordinary period pain. See a doctor if the pain stops you doing daily life, if you are bleeding through a pad or tampon every hour, if the pain suddenly got much worse than your usual, or if you have pain with a fever. None of those are things to manage with a hack.
These statements have not been evaluated by the Food and Drug Administration. This product is not intended to diagnose, treat, cure, or prevent any disease.