You can experience a fever and headache at the same time due to certain illnesses and health conditions, including infections, allergies, and reactions to medications, among other causes.

Headache and fever are common symptoms of several kinds of illnesses. Mild types like the seasonal flu virus and allergies can cause these symptoms. Sometimes getting a fever can give you a headache.

Headache pain and fever are common in both adults and children. In some cases, they may signal that your body is fighting a more serious infection or illness. Read on for the different causes of a headache and fever.

A fever is a rise in your body temperature. This can happen when your body is fighting an infection. Viruses, bacteria, fungi, and parasites can cause infections.

Other illnesses and inflammation can also trigger a fever. You might have a fever if your body temperature is higher than 98.6°F (37°C). A fever can lead to changes in your body that may lead to a headache.

1. Allergies

If you’re allergic to pollen, dust, animal dander or other triggers, you may get a headache. Two kinds of headache pain are linked to allergies: migraine attacks and sinus headaches.

Allergies may cause headaches due to nasal or sinus congestion. This happens when an allergic reaction makes the passageways inside and around your nose and mouth inflamed and swollen.

Allergy headache symptoms may include:

  • pain and pressure around your sinuses and eyes
  • throbbing pain on one side of your head

Allergies don’t typically cause a fever. However, they can make you more likely to get a viral or bacterial infection. This can lead to a fever and more headache pain.

2. Colds and flu

Colds and the flu are caused by viruses. A viral infection may give you a fever and cause headaches. Getting the flu or catching a cold can also make migraine attacks and cluster headaches worse.

Cold and flu viruses may cause inflammation, swelling, and liquid to build up in your nose and sinuses. This leads to headache pain. You may also have other cold and flu symptoms, such as:

  • runny nose
  • sore throat
  • chills
  • fatigue
  • nausea
  • vomiting
  • loss of appetite
  • sore eyes
  • pressure around eyes
  • sensitivity to sound or light

3. Bacterial infections

Some kinds of bacteria can cause infections in your lungs, airways, sinuses around your nose, kidneys, urinary tract and other areas.

Bacterial infections can also happen through a wound or a cavity in your tooth. Some bacterial infections can spread throughout the body. This may be life-threatening and requires urgent treatment.

Symptoms of a bacterial infection depend on what area of the body it’s in. Common symptoms include fever and headaches. Symptoms of a bacterial infection in the lungs also include:

  • coughing
  • phlegm production
  • shortness of breath
  • chills and shaking
  • chest pain
  • sweating
  • fatigue
  • muscle pain

4. Ear infection

Ear infections may be caused by a bacterial or viral infection. They’re more common in children than in teens and adults.

They can cause a buildup of liquid inside the middle ear. This causes pressure and pain in and around the ear.

Ear infections can cause headaches and fever. See your doctor if you or your child has an ear infection. Some cases can cause lasting damage to the ears. Symptoms include:

  • ear pain
  • fever of 100°F (37.8°C) or higher
  • loss of appetite
  • irritability
  • loss of balance
  • difficulty sleeping

5. Meningitis

Fever and headache pain are among the first symptoms of meningitis. This serious illness happens when an infection attacks the lining around the brain and spinal cord. A meningitis infection is usually caused by a virus, though bacterial and fungal infections can also be the cause.

Meningitis can happen to both children and adults. It can be life-threatening and requires urgent medical treatment. Look for these symptoms of meningitis:

  • high fever
  • severe headache
  • stiff neck
  • nausea
  • vomiting
  • sleepiness
  • sensitivity to light
  • listlessness
  • difficulty waking up
  • lack of appetite and thirst
  • skin rash
  • seizure

6. Heatstroke

Heatstroke is also called sunstroke. Heatstroke happens when your body overheats. This can happen if you’re in a very warm place for too long. Exercising too much at a time in hot weather can also cause lead to heatstroke.

A heatstroke is an emergency condition. If not treated, it can lead to damage of the:

  • brain
  • heart
  • kidney
  • muscle

A fever of 104°F (40°C) or higher is the main symptom of heatstroke. You may also have a throbbing headache. Other symptoms of heatstroke include:

  • nausea
  • vomiting
  • flushed skin
  • hot, dry or moist skin
  • rapid, shallow breathing
  • racing heart rate
  • confusion
  • slurred speech
  • delirium
  • seizures
  • fainting

7. Rheumatoid arthritis

Rheumatoid arthritis (RA) and other kinds of inflammatory conditions may trigger fevers and headache pain. This kind of arthritis happens when your body mistakenly attacks your joints and other tissues.

About 40 percent of people with RA also have pain and other symptoms in areas such as the:

  • eyes
  • lungs
  • heart
  • kidneys
  • nerves
  • blood vessels

If you have RA, you may have a higher risk of infections. Some medications to treat RA and other autoimmune diseases can also raise your risk. This is because they work by slowing down immune system activity.

Infections, medications, and stress due to RA may indirectly cause fever and headaches. Other symptoms of RA include:

  • stiffness
  • pain
  • joint swelling
  • warm, tender joints
  • fatigue
  • loss of appetite

8. Medications

Certain medications can cause fever and headache pain. These include:

Taking too much pain-relieving medication, or taking it too often, can also cause headaches and other symptoms. These include migraine medications, opioids, and over-the-counter pain relief medications.

If you have a headache from medication overuse, you may also have:

  • nausea
  • restlessness
  • irritability
  • difficulty concentrating
  • memory problems

9. Vaccinations

Fever and headache pain may happen after getting a vaccine. Most vaccines may cause a slight fever within 24 hours, and last one to two days. Some immunizations can cause a delayed reaction.

The MMR and chickenpox vaccines can cause a fever one to four weeks after getting it. You may get a fever and headache because your body is reacting to the vaccine as it builds immunity against disease. Other symptoms include:

  • rash
  • fatigue
  • nausea
  • vomiting
  • loss of appetite

10. Cancer

Cancer and other serious illnesses can cause fever and headache pain. The American Cancer Society notes that it’s common for people with any type of cancer to have fevers. This is sometimes a sign that you also have an infection.

In other cases, changes in the body due to illness or a tumor can trigger a fever. Cancer treatments such as chemotherapy and radiation therapy can also cause fever and headaches.

Other side effects include nausea, vomiting, and loss of appetite. This can cause dehydration and involve eating too little. These effects may also trigger fever and headache pain.

Treatment for headaches and fever depends on the cause. Bacterial infections may require antibiotics. Colds and flu viruses usually don’t require treatment and go away on their own.

Your doctor may recommend rest and over-the-counter medications for symptoms of colds, flu, other infections, and allergies. These include:

  • pain relievers
  • cough suppressants
  • decongestants
  • antihistamines
  • saline or corticosteroid nasal sprays

In some cases, your doctor may prescribe:

  • allergy shots
  • antifungal medications
  • antiviral medications
  • migraine medication

At-home treatments may help relieve cold, flu, and allergy symptoms. These can help soothe headaches and reduce fevers.

  • get plenty of rest
  • drink warm drinks and plenty of fluids to thin mucus
  • apply a cool, damp cloth to your eyes, face, and neck
  • steam inhalation
  • sit in a warm bath
  • have a cool sponge bath
  • drink warm broth or chicken soup
  • eat frozen yogurt or a popsicle
  • essential oils like eucalyptus and tea tree oil
  • apply peppermint oil to your temples

Considerations for kids

Check with your child’s pediatrician before using essential oils. Some essential oils aren’t safe for children. If you’re pregnant or breastfeeding, also check with your doctor before trying essential oils and other natural remedies.

Help prevent infections and allergies to reduce headaches and fevers. Some tips for yourself and your child include:

  • avoiding allergens that trigger allergic reactions
  • lining your nostrils with a very thin layer of petroleum jelly to help block allergens
  • washing your face several times a day
  • rinsing your mouth and nostrils
  • applying a warm or cool, damp washcloth to your face several times a day
  • teaching your child to avoid sharing bottles and drinks with other children
  • teaching children how to correctly wash their hands
  • washing toys and other items with warm soapy water, especially if your child has been ill
  • getting a flu shot

In some cases, you may need treatment if you have a fever, headaches, or other symptoms. Get medical attention if you have:

  • a temperature of 103°F (39.4°C) or higher
  • a severe headache
  • skin rash
  • stiff neck or neck pain
  • difficulty breathing
  • abdominal pain
  • pain when urinating
  • mental fogginess or confusion
  • frequent vomiting
  • seizures or fainting

If your child has a fever and headache pain after receiving vaccinations, the Seattle Children’s Hospital advises that you should get urgent medical help if they:

  • are less than 12 weeks old
  • have a stiff neck
  • aren’t moving their neck normally
  • are crying for more than three hours
  • have high-pitched crying for more than one hour
  • aren’t crying or responding to you

Take your child to their pediatrician if:

  • a fever lasts for more than three days
  • redness around an immunization injection site is larger than three inches
  • redness or red streaks on the skin happen more than two days after getting an immunization
  • they’re touching or pulling at their ear
  • they get blisters or lumps anywhere

Headaches and fever are caused by a range of illnesses. These include common and mild infections. Most of these illnesses get better on their own. Viral infections like a cold or flu can’t be cured with antibiotics.

In some cases, a headache and fever may be a sign of more serious illness. See your doctor if your headaches are more severe or feel different than they normally do. Also get medical help if your fever is higher than 103°F (39.4°C) or doesn’t improve with medication therapy.

Look for signs of serious infections like meningitis in children. Bacterial infections may need antibiotic treatment. Leaving them untreated can lead to life-threatening complications.