It’s not unusual to have a headache after you exercise. You might feel the pain on one side of your head or experience throbbing pain across your entire head. Several things can cause this to happen.

In most cases, it’s something simple that’s easy to fix.

Read on to learn more about the common causes and how to treat them. We’ll also explain how to avoid a headache after your next workout.

An exertional headache is a type of headache that’s triggered by some type of physical activity. This can be anything from a coughing fit to a strenuous workout. You might feel it come on during or after your workout.

People often describe exertional headaches as a pulsating pain on both sides of the head. The pain can last anywhere from a few minutes to a couple of days.

This type of headache only happens with exercise. People are also more likely to develop primary exercise headaches when working out in warm weather or at high altitudes.

Exertional headaches can be either primary or secondary:

  • Primary exertional headaches happen for unknown reasons. But experts think it could be related to the narrowing of your blood vessels that happens when you exercise.
  • Secondary exertional headaches are similarly triggered by physical activity, but this response is due to an underlying condition. This underlying condition can range from a simple sinus infection to a tumor.

Keep in mind that secondary exertional headaches usually come with other symptoms, such as:

  • vomiting
  • congestion
  • neck stiffness
  • vision issues

Exertional headaches can also be mistaken for exercise-induced migraines.

How to treat it

If you frequently get headaches after exercising and have any other unusual symptoms, it’s best to make an appointment with a doctor to rule out any underlying conditions that might need treatment.

Otherwise, primary exercise headaches often stop happening on their own after a few months.

In the meantime, taking an over-the-counter anti-inflammatory, such as ibuprofen (Advil), can help. You can also try applying a heating pad to your head to open up the blood vessels. No heating pad? Here’s how to make one at home.

How to prevent it

Drink fluids before and during exercise. For some, slowly warming up before exercising can help to prevent exertional headaches. In other cases, reducing the intensity of the workout also helps to prevent them.

But if these don’t help, or reducing intensity isn’t an option, take indomethacin or prescription-strength naproxen. You’ll need a prescription from a doctor for these. Both can cause stomach irritation in some people. If you’re unable to take them, your doctor might suggest trying beta-blockers.

Dehydration happens when your body loses more fluid than it takes in. Chances are, you sweat when you exercise. This counts as fluid loss. If you don’t drink enough water before exercising, it’s easy to become dehydrated.

A headache is often the first sign of dehydration. Other symptoms of mild dehydration include:

  • heightened sense of thirst
  • feeling lightheaded or dizzy
  • fatigue
  • decreased urine output
  • producing fewer tears
  • dry skin and mouth
  • constipation

More severe hydration can lead to:

  • excessive thirst
  • reduced sweating
  • low blood pressure
  • rapid heartbeat breathing
  • dark-colored urine
  • rapid breathing
  • sunken eyes
  • shriveled skin
  • fever
  • seizure
  • death

Severe dehydration is a medical emergency. If you begin experiencing these symptoms, seek immediate treatment.

How to treat it

Most cases of mild hydration respond well to replenishing lost fluids and electrolytes. You can do this by drinking plenty of water.

A sports drink can help to restore your electrolytes, but these often contain a lot of added sugar that can make a headache worse. Instead, try reaching for some unsweetened coconut water. You can also try our recipe for an electrolyte drink you can make at home.

How to prevent it

Try to drink 1 to 3 cups of water over the course of an hour or two before exercising. You can also carry a water bottle during your workout so you can replenish your body as it sweats. Make sure to follow up with a glass or two after your workout as well.

Sun exposure can be a trigger for headaches in a lot of people, even when they aren’t exercising. This is especially true if it’s hot out.

How to treat it

If you’ve been exercising outside in the sun and develop a headache, head inside if you can. Try to spend some time in a dark or low-light room.

If the weather’s warm, bring a glass of water and a cool, damp washcloth. Place it over your eyes and forehead for a few minutes.

Taking a lukewarm shower can also help.

If you don’t have time to cool down, you can also take a nonsteroidal anti-inflammatory, such as ibuprofen (Advil).

How to prevent it

Before heading outside to exercise, grab a pair of sunglasses or a wide-brimmed hat to shield your face and eyes. If it’s warm out, you can also try wrapping a damp bandana around your neck.

Carrying a small spray bottle containing cold water can also help. Use it to spray your face periodically. Pay attention when you are feeling very hot or short of breath and seek further cooling.

Low blood sugar, also called hypoglycemia, can also cause a headache after exercising. Blood sugar refers to glucose, which is one of your body’s main energy sources. If you don’t eat enough before working out, your body can burn through glucose, leading to hypoglycemia.

A headache is one of the main symptoms of hypoglycemia. Other symptoms include:

  • shaking
  • feeling extremely hungry
  • dizziness
  • sweating
  • blurry vision
  • changes in personality
  • difficulty concentrating
  • disorientation

How to treat it

If you’re having symptoms of low blood sugar, try to eat or drink something containing 15 grams of carbohydrates right away, such as a glass of fruit juice or a small piece of fruit. This is a quick fix that should hold you over for a few minutes.

Make sure to follow up with some complex carbohydrates, such as a piece of whole-grain toast, to avoid another crash.

How to prevent it

Try to eat a nutritious, balanced meal or snack within two hours of exercising. Aim for something with protein, complex carbohydrates, and fiber to help balance blood sugar. Avoid sugar or processed, refined carbohydrates.

Not sure what to eat? Here’s everything you need to know about eating before a workout.

Exercising with poor form can lead to muscle tension, which can quickly turn into a headache, especially if you’re using your neck and shoulder muscles. Weight lifting, pushups, crunches, and running can all lead to tension in your neck if they aren’t done properly.

How to treat it

If your workout involves things that could strain your neck, try doing some gentle stretches afterward. Here are 12 to get you started. If releasing tension isn’t quite doing the trick, you can also take some ibuprofen for relief.

How to prevent it

Set aside some time to do your usual workout in front of a mirror. You can also set up your phone to record your work out. Watch a replay to see if you notice any issues with your form.

If you’re not sure about the right way to do an exercise, consider doing a session or two with a personal trainer. They can walk you through how to properly do some of your usual exercises. Local gyms can refer you to a reputable trainer.

While getting a headache after exercising usually isn’t anything to worry about, consider making an appointment with a doctor if they seem to start happening out of the blue.

For example, if you’ve been doing the same exercise routine for months without any problems, but suddenly start getting headaches, see a doctor. There could be something else going on.

It’s also best to see a doctor if your headaches aren’t responding to any treatments, including over-the-counter medications.

Most exercise-related headaches can be easily treated at home, but sometimes they could be a sign of an underlying condition. Simple prevention and home treatment methods should help alleviate your headaches. But if they aren’t doing the trick, it might be time to talk to a doctor.