The best medicine for a headache depends on what type of headache you’re dealing with. For most everyday headaches, over-the-counter pain relievers like ibuprofen, acetaminophen, or aspirin work well and act within 30 to 60 minutes. Migraines, cluster headaches, and chronic headaches each call for different approaches, and picking the right one can mean the difference between fast relief and hours of unnecessary pain.
Over-the-Counter Options for Everyday Headaches
Tension headaches are the most common type, and simple pain relievers are the first-line treatment. Ibuprofen (Advil, Motrin), naproxen sodium (Aleve), and aspirin all belong to a class of drugs called NSAIDs. They work by reducing inflammation and blocking pain signals. Acetaminophen (Tylenol) takes a different route, acting primarily in the brain to dampen pain perception rather than targeting inflammation directly.
For tension headaches specifically, ibuprofen and naproxen tend to be the most effective choices. Acetaminophen works too, though it may be slightly less potent for this type of headache. The tradeoff is that acetaminophen is gentler on your stomach and kidneys, making it the better pick if you have digestive issues, kidney problems, or a history of ulcers.
Some people reach for combination products that pair acetaminophen with aspirin and caffeine (like Excedrin). Caffeine narrows blood vessels and can boost the effectiveness of pain relievers by roughly 40%, which is why it shows up in so many headache formulas.
Medicines for Migraines
If you get migraines, standard pain relievers sometimes aren’t enough. Triptans are prescription medications designed specifically for migraine attacks. Seven different triptans are available in the U.S., including sumatriptan, rizatriptan, zolmitriptan, and others. They come as regular tablets, dissolving tablets that melt on your tongue, nasal sprays, and even injections. The variety matters because migraines often cause nausea and vomiting, making it hard to keep a pill down. A nasal spray or dissolving tablet can bypass that problem.
Triptans work by targeting serotonin receptors in the brain, constricting dilated blood vessels and quieting the overactive nerve signals that drive migraine pain. Most people feel relief within one to two hours of taking one. They’re most effective when taken early in an attack, before the pain becomes severe.
A newer class of medications called gepants offers an alternative for people who can’t tolerate triptans or have heart disease (triptans constrict blood vessels, which makes them off-limits for some). Gepants block a protein called CGRP that plays a central role in triggering migraines. They’re taken as oral pills and can be used both to stop an attack in progress and to prevent future ones.
Preventive Medications for Frequent Headaches
If you’re getting migraines or severe headaches multiple times a month, your doctor may suggest a preventive medication rather than just treating each episode. CGRP-targeting injections are one option. Four are currently available: erenumab, galcanezumab, fremanezumab, and eptinezumab. Most are self-administered as a monthly injection under the skin, similar to an insulin shot. They reduce the number of migraine days per month, often by half or more.
Several supplements have also shown benefit for migraine prevention in clinical trials. A combination of 400 mg of riboflavin (vitamin B2), 600 mg of magnesium, and 150 mg of coenzyme Q10 taken daily for three months reduced migraine frequency in a placebo-controlled trial. These aren’t as potent as prescription preventives, but they carry fewer side effects and can be a reasonable starting point if your migraines are moderate.
Cluster Headache Treatment Is Different
Cluster headaches are less common but far more intense, often described as the worst pain a person can experience. They come on fast, peak within minutes, and typically last about an hour. Because of that rapid onset, oral medications are too slow to help.
The two primary treatments are high-flow oxygen through a non-rebreathing mask and injectable or nasal triptan formulations. Sumatriptan as a 6 mg injection under the skin works fastest. Sumatriptan 20 mg nasal spray and zolmitriptan 5 mg nasal spray are also effective. Oral triptans are specifically not recommended for cluster headaches because the attack will peak and start to fade before a pill can take effect.
Dosing Limits and Safety Risks
Acetaminophen has a firm ceiling: no more than 4,000 mg per day from all sources combined, though staying under 3,000 mg is safer if you’re taking it regularly. Going over that limit risks serious liver damage. The “all sources” part is critical because acetaminophen hides in cold medicines, sleep aids, and combination painkillers. It’s easy to double up without realizing it.
NSAIDs like ibuprofen and naproxen carry their own risks. They should be avoided if you have chronic kidney disease, heart failure, or liver cirrhosis, because they can reduce blood flow to the kidneys and trigger acute kidney failure in these conditions. They also increase the risk of stomach ulcers and bleeding, especially with long-term use. If you fall into any of these categories, acetaminophen is the safer choice for occasional headaches.
When Pain Relievers Start Causing Headaches
One of the most frustrating headache traps is medication overuse headache, sometimes called rebound headache. If you take acute headache medicine on 10 to 15 or more days per month for longer than three months (the exact threshold depends on the medication), your brain can adapt to the frequent dosing and start producing headaches when the drug wears off. This creates a cycle where you take more medicine, which causes more headaches.
Triptans and combination painkillers with caffeine are the most common culprits, with a threshold of 10 days per month. Simple painkillers like ibuprofen or acetaminophen alone have a slightly higher threshold of 15 days per month. If you find yourself reaching for headache medicine more than two or three days a week on a regular basis, that pattern itself may be part of the problem.
Headache Medicine During Pregnancy
Pregnancy significantly narrows the list of safe options. Acetaminophen is the go-to pain reliever for headaches during pregnancy. NSAIDs like ibuprofen and naproxen are associated with a higher risk of miscarriage and developmental problems in the fetus, and they’re contraindicated in later pregnancy.
For pregnant people who need migraine prevention, magnesium oxide and low-dose amitriptyline (a tricyclic antidepressant) are typical first-line choices. Non-drug approaches also play a bigger role during pregnancy: staying well-hydrated, physical therapy, and nerve blocks (injections near specific nerves in the scalp) are all used when medications need to be minimized. Antihistamines and caffeine in moderate amounts are also considered acceptable during pregnancy for headache relief.