What Medicine Helps With Headaches: OTC to Prescription

The most effective medicine for a headache depends on what type of headache you’re dealing with and how severe it is. For the occasional mild to moderate headache, over-the-counter pain relievers like ibuprofen, acetaminophen, and aspirin are the standard first-line treatments. When headaches are more intense, more frequent, or fall into specific categories like migraines or cluster headaches, prescription options and preventive strategies become important.

Over-the-Counter Pain Relievers

NSAIDs (ibuprofen, aspirin, and naproxen) are the most commonly used drugs worldwide for mild to moderate headache pain. They work by blocking enzymes that produce pain-signaling chemicals called prostaglandins. These prostaglandins sensitize pain pathways in both the brain and peripheral nerves, so shutting down their production reduces the throbbing, pressure, or aching you feel. Ibuprofen and aspirin tend to work within 30 to 60 minutes, while naproxen lasts longer and can be a better choice if your headaches tend to linger for hours.

Acetaminophen takes a different approach. It doesn’t target inflammation the way NSAIDs do, but it’s effective for tension-type headaches and mild migraines, and it’s gentler on the stomach. The maximum safe dose for adults is 4,000 milligrams in 24 hours, though staying well below that limit is wise, especially if you drink alcohol or have any liver concerns. Combination products that pair acetaminophen with caffeine can boost its effectiveness, since caffeine narrows blood vessels and helps your body absorb the medication faster.

One important rule: don’t use any single pain reliever too often. The International Headache Society defines medication overuse headache as headache occurring 15 or more days per month in someone who regularly takes acute pain medication for more than three months. The threshold varies by drug type, with some medications flagged at 10 or more days of use per month. If you find yourself reaching for pain relievers most days of the week, that pattern itself may be making your headaches worse.

Medicines for Migraines

When a migraine is mild to moderate, NSAIDs or acetaminophen can still be enough. But for moderate to severe migraines, triptans are the first-line prescription treatment. These medications are designed specifically for migraines. They activate serotonin receptors in the brain, which narrows dilated blood vessels and quiets the overactive pain signaling network that drives migraine attacks. Most people feel meaningful relief within one to two hours.

Triptans come in several forms: tablets, nasal sprays, and injections. The nasal spray and injectable versions work faster, which matters when a migraine is escalating quickly or when nausea makes swallowing a pill difficult. Your doctor will typically start with an oral form and adjust based on how well it works and how fast your migraines tend to build.

For people who get migraines frequently, preventive medications can reduce the number of attacks before they start. A newer class of drugs targets a protein called CGRP, which plays a central role in triggering migraine pain. In clinical trials, these medications reduced monthly migraine days significantly compared to placebo over a 12-week period. They’re typically given as a monthly or quarterly injection and are reserved for people who experience migraines on many days each month or who haven’t responded well to older preventive options.

Treatment for Tension-Type Headaches

Tension headaches, the most common type, respond well to OTC pain relievers for occasional episodes. The challenge comes when they become chronic, meaning they occur 15 or more days per month. At that point, relying on pain relievers alone risks medication overuse headache, and preventive treatment makes more sense.

Certain antidepressants taken at low doses are the preferred preventive option for chronic tension-type headaches. Tricyclic antidepressants are the drugs of choice here, not because of their effect on mood, but because they alter how pain signals are processed in the brain. They’re typically started at a low dose at bedtime and gradually increased. It takes four to six weeks before you’ll notice improvement, so patience is essential.

Muscle relaxants are sometimes tried as well. One study found that half of patients taking a specific muscle relaxant experienced at least a 50% improvement, compared to only a quarter of those on placebo. However, most muscle relaxants haven’t been proven effective for acute tension headache pain. They’re more useful as a preventive strategy taken regularly, not as something you pop when a headache hits.

Cluster Headache Treatments

Cluster headaches are among the most painful headache types, and they require different treatment entirely. Standard OTC pain relievers are too slow to help, since cluster attacks peak rapidly and may last only 15 to 90 minutes.

The two primary fast-acting treatments are high-flow oxygen and injectable triptans. Breathing pure oxygen through a mask provides relief for most people within 15 minutes and is considered extremely safe. An injectable form of sumatriptan, a triptan, works quickly when given as a shot at the start of an attack. Nasal spray versions of triptans also work but not as fast as the injection. Oral medications are generally avoided for cluster headaches because they simply can’t be absorbed quickly enough.

Other options for people who don’t respond to oxygen or triptans include nasal anesthetics and injectable forms of certain hormonal medications, though these are less commonly used.

Supplements That May Help Prevent Headaches

Several supplements have enough evidence behind them that headache specialists routinely recommend them, particularly for migraine prevention. They tend to work best as daily preventive measures rather than acute treatments.

  • Magnesium: The American Headache Society recommends 400 to 500 milligrams daily of magnesium oxide. It’s especially worth trying if your migraines include aura (visual disturbances before the headache starts).
  • Riboflavin (vitamin B2): A daily dose of 400 milligrams has been shown to reduce migraine frequency. It’s well tolerated, though it will turn your urine bright yellow.
  • CoQ10: Research has found that 300 milligrams daily can reduce how often migraines occur in adults.
  • Melatonin: A typical dose of 3 milligrams before bed each night may help with migraine prevention, with the added benefit of improving sleep.

One supplement to avoid: butterbur. While older studies showed it could reduce migraine frequency, it has been linked to liver toxicity and is no longer recommended by headache specialists.

Headache Medicine During Pregnancy

Pregnancy significantly narrows your options. Acetaminophen, up to 1,000 milligrams three times per day, is the recommended first-line treatment for headaches during pregnancy. It can safely be combined with caffeine up to 200 milligrams per day.

NSAIDs should be avoided during the first and third trimesters but can be used in the second trimester. Triptans, CGRP medications, and products containing butalbital should all be avoided. Ergot-based medications are contraindicated because they can stimulate uterine contractions. For prevention, calcium channel blockers and antihistamines are considered the safest options during pregnancy.

During breastfeeding, the rules relax somewhat. Acetaminophen and NSAIDs are both safe while nursing. Caffeine is generally fine but should be used cautiously, since young and preterm infants metabolize it slowly.

Choosing the Right Approach

For a simple, occasional headache, start with an OTC pain reliever. Ibuprofen or a combination of acetaminophen and caffeine tends to work fastest for most people. If your headaches are frequent (more than a couple of times per week), severe enough to stop your normal activities, or accompanied by nausea, visual changes, or one-sided throbbing, those are signs you may need a targeted prescription treatment rather than just more OTC medication. Keeping a headache diary that tracks frequency, severity, and what you’ve taken can help you and your doctor find the right match faster.