Masturbation can help relieve certain types of headaches, particularly tension headaches. The pain relief comes from a surge of natural painkillers your body releases during sexual arousal and orgasm. But the effect isn’t universal: it works better for some headache types than others, and for some people, orgasm can actually trigger a headache instead of fixing one.
Why Orgasm Relieves Pain
During sexual arousal and orgasm, your body floods itself with endorphins, which are natural opioid-like chemicals that dull pain signals. This isn’t a vague “feel-good” effect. Lab studies have measured it directly: pain tolerance thresholds increase significantly during genital stimulation and increase even more when orgasm is reached. The analgesic effect isn’t limited to the moment of climax either. Opioid and endorphin release begins during arousal, before orgasm, meaning the pain-relieving process starts as soon as you’re sexually engaged.
Beyond endorphins, orgasm also triggers a release of tension throughout the body. Muscles that have been clenching (especially in the neck, shoulders, and scalp) relax during and after climax. For headaches rooted in physical tension, this muscle release alone can be enough to make the pain fade.
Which Headaches It Helps
The type of headache you have matters a lot. Tension headaches, the most common kind, are the best candidates. These headaches are driven by stress and muscle tightness, and orgasm directly counteracts both. As neurologist Nestor Galvez-Jimenez at the Cleveland Clinic explains, the release from orgasm can relieve stress and muscle tension enough to make a tension headache go away.
Migraines are more complicated. In a study of migraine patients published in Cephalalgia, 34% had tried sexual activity during an attack. Of those, 60% reported improvement, and 70% of that group described moderate to complete relief. That sounds promising, but it also means 33% of migraine patients who tried it said their migraine got worse. So for migraines, orgasm is roughly a coin flip between helping and doing nothing, with a real chance of making things worse.
Cluster headaches, sinus headaches, and headaches caused by dehydration or illness are unlikely to respond meaningfully to orgasm. The mechanism doesn’t address their underlying causes.
How Long the Relief Lasts
The endorphin surge from orgasm is temporary. For tension headaches, the combination of muscle relaxation and pain signal suppression can sometimes resolve the headache entirely, especially if the headache was mild to moderate. For migraines that do respond, the relief may last anywhere from minutes to the duration of the attack, though clinical data on exact timelines is limited. If a headache returns after the endorphin effect wears off, that’s typical. Orgasm isn’t treating the root cause of a migraine the way medication would.
When Orgasm Causes Headaches Instead
There’s an important flip side to this question. Some people experience headaches triggered by sexual activity itself. This condition, called primary headache associated with sexual activity, is well documented in headache medicine. It typically presents in one of two patterns: a dull, building ache that intensifies alongside arousal, or a sudden, explosive headache that hits just before or during orgasm.
These headaches can be intense. Severe episodes last anywhere from 1 minute to 24 hours, while milder pain can linger up to 72 hours. They’re more common in men than women (by a ratio of roughly 1.2 to 3 times more frequent), tend to be felt on both sides of the head in about two-thirds of cases, and are most often concentrated at the back of the skull. Up to 40% of people who develop these headaches find they recur chronically for over a year.
If you’ve never had a headache during sexual activity before and suddenly experience a severe, explosive headache at orgasm, that warrants medical attention. While most sex-related headaches are benign, a sudden onset can sometimes signal something more serious involving blood vessels in the brain. The benign form doesn’t come with vomiting, vision changes, or loss of consciousness. If any of those accompany the headache, it’s a different situation entirely.
Practical Takeaways
If you have a tension headache driven by stress or tight muscles, masturbation is a reasonable thing to try. The physiology supports it, and there’s very little downside. For migraines, it’s unpredictable. A majority of people who try it during a migraine report some benefit, but roughly one in three find it makes the attack worse. There’s no reliable way to predict which group you’ll fall into without trying it yourself during a mild episode.
Masturbation works through the same mechanisms as partnered sex for these purposes. The key ingredient is orgasm and the neurochemical cascade it triggers, not the type of sexual activity. If you regularly get headaches during or after orgasm, though, that’s a separate condition worth discussing with a doctor, especially if the onset is new or the pain is unusually severe.

