How to Treat a Headache: Fast Relief and Prevention

Most headaches respond well to over-the-counter pain relievers, hydration, and rest. The right treatment depends on what type of headache you’re dealing with, so identifying your symptoms is the first step toward relief.

Identify Your Headache Type First

Tension headaches are the most common. They feel like constant pressure or tightness across both sides of the head, sometimes extending to the face and neck. They last anywhere from 30 minutes to 7 days. Unlike migraines, they don’t cause nausea or vomiting, don’t worsen with normal physical activity like walking or climbing stairs, and don’t cause sensitivity to both light and sound at the same time.

Migraines produce moderate to severe throbbing pain, usually on one side of the head. They often come with nausea, sensitivity to light and sound, and sometimes visual disturbances beforehand (aura). If your headache pounds harder when you move around, that points toward migraine.

Cluster headaches are less common but intensely painful. The pain centers behind or around one eye, peaks within 5 to 10 minutes, and can last up to three hours. The eye on the affected side often turns red and teary, and the nose may swell. People with cluster headaches typically get one to three attacks per day during a cluster period.

Over-the-Counter Pain Relievers

For tension headaches, acetaminophen and low-dose anti-inflammatory drugs like ibuprofen work about equally well. A meta-analysis of six trials found no meaningful difference in pain relief between the two at standard doses. Higher doses of anti-inflammatories may offer slightly more relief, but they also carry a higher risk of side effects like stomach irritation, so the tradeoff isn’t always worth it.

For migraines, anti-inflammatory drugs tend to work better than acetaminophen, especially when taken early. Combination products that pair acetaminophen with a small dose of caffeine can also be effective, since caffeine helps your body absorb pain medication faster and has mild pain-relieving properties of its own.

Whichever you choose, timing matters. Taking a pain reliever at the first sign of a headache is significantly more effective than waiting until the pain is fully established. The maximum safe dose of acetaminophen is 4,000 milligrams in 24 hours, though staying well below that limit is wise, especially if you drink alcohol. Follow the label for ibuprofen spacing, typically every 6 to 8 hours.

One important caution: using pain relievers more than two or three days per week can cause medication-overuse headaches, where the drugs themselves start triggering headache cycles. If you find yourself reaching for painkillers that frequently, it’s time to talk to a doctor about a preventive approach.

Quick Relief Without Medication

A cold compress applied to the forehead or temples can reduce headache pain, particularly for migraines. Keep it on for no more than 20 minutes at a time, with a cloth between the ice and your skin. You can repeat this several times throughout the day.

Heat works differently. A warm towel or heating pad on the back of the neck or shoulders helps relax the tight muscles that fuel tension headaches. If your headache feels like a band squeezing your head and your neck or shoulders are stiff, try heat first.

Resting in a dark, quiet room is one of the simplest and most effective strategies for migraines. Light and sound amplify migraine pain, so removing those inputs gives your nervous system a chance to calm down. Even 20 to 30 minutes of lying still with your eyes closed can take the edge off.

Hydration and Headache Relief

Dehydration is one of the most overlooked headache causes. A study that added 1.5 liters of water per day (about six extra glasses) to participants’ normal intake found that 47% of the water group reported meaningful improvement in headache symptoms, compared with 25% in the control group. Migraine-specific quality of life scores improved significantly as well.

If your headache came on after a long stretch without drinking, during hot weather, or after exercise or alcohol, start with two full glasses of water and continue sipping steadily. Dehydration headaches typically begin to ease within 30 minutes to an hour of rehydrating.

Prescription Options for Migraines

If over-the-counter options aren’t cutting it for migraines, triptans remain the most effective class of prescription medication. A large meta-analysis comparing all available migraine drugs found that triptans consistently outperformed newer alternatives for pain freedom within two hours. The most effective option in the analysis had a 95.4% likelihood of being the top-ranked treatment for complete pain freedom.

Newer medications that target a pain signaling pathway specific to migraines (called CGRP) are a good alternative for people who can’t tolerate triptans or who have heart disease, since triptans constrict blood vessels. These newer drugs cause fewer side effects overall, though they don’t relieve pain quite as quickly or completely as the best-performing triptans.

Preventing Headaches Long-Term

If you get frequent headaches, prevention is more effective than repeatedly treating individual episodes. Start by tracking your triggers. Common dietary triggers include alcohol (especially red wine, which 77 to 91% of alcohol-sensitive migraine patients identify as problematic), aged cheeses, cured meats containing nitrates, and foods high in MSG. That said, triggers are highly individual. In studies, fewer than half of people who identified red wine as a trigger actually got a migraine more than 50% of the time after drinking it. A headache diary tracking food, sleep, stress, weather, and menstrual cycle helps you find your personal patterns.

Regular sleep matters enormously. Both too little and too much sleep can trigger headaches, so aim for consistent wake and sleep times, even on weekends. Skipping meals is another reliable trigger, particularly for migraines.

Some supplements show promise for reducing headache frequency. Riboflavin (vitamin B2) at doses as low as 25 milligrams per day has shown effects comparable to higher-dose combination supplements in clinical trials, with both groups experiencing significant reductions in migraine frequency compared to their baseline. Magnesium at 300 milligrams daily is also commonly recommended, though the clinical evidence is mixed. These supplements take several weeks to show benefit, so they’re a long-term strategy, not an acute treatment.

Red Flags That Need Urgent Attention

Most headaches are uncomfortable but harmless. A small number signal something serious. Seek immediate medical care if your headache fits any of these patterns:

  • Thunderclap onset: a severe headache that reaches maximum intensity within one minute. This can indicate bleeding in the brain.
  • Neurological symptoms: confusion, difficulty speaking, vision loss, weakness on one side of the body, or decreased consciousness alongside the headache.
  • Fever and stiff neck: this combination can signal meningitis or another infection.
  • New headache after age 65: first-time or changed headache patterns in older adults have a higher rate of serious underlying causes.
  • Headache after head trauma: any headache that develops shortly after a blow to the head needs evaluation.
  • Progressive worsening: a headache that steadily intensifies over days or weeks without responding to treatment.
  • Positional component: a headache that strikes immediately upon standing and resolves when lying down may indicate low spinal fluid pressure.

A headache that simply feels different from your usual pattern, particularly one that came on recently and doesn’t match any headache you’ve had before, is also worth getting checked out.