What Causes a Fever: Infections, Drugs, and More

A fever happens when your brain temporarily raises your body’s internal temperature above its normal set point, almost always as a defensive response to something your immune system has detected. A temperature of 100.4°F (38°C) or higher, measured orally or rectally, is the standard threshold. Fevers are not an illness themselves but a signal that your body is actively fighting something, whether that’s an infection, inflammation, or a reaction to medication.

How Your Body Creates a Fever

Your brain has a built-in thermostat located in a region called the hypothalamus. Normally it keeps your core temperature hovering around 98.6°F. When your immune system detects a threat, such as bacteria or a virus, specialized cells called macrophages release signaling molecules (the key ones being interleukin-1, interleukin-6, and tumor necrosis factor). These molecules travel through the bloodstream and reach a specific part of the brain where blood vessels are permeable enough to let them pass through.

Once there, they trigger the production of a chemical called prostaglandin E2, which essentially turns the thermostat dial up. Your brain now treats your normal body temperature as “too cold” and activates warming mechanisms: blood vessels near the skin constrict to trap heat inside, your muscles begin to shiver to generate warmth, and you feel an urge to bundle up. This is why you can feel freezing cold even though your body is actually heating up. The process continues until your temperature reaches the new, higher set point.

This elevated temperature serves a purpose. Many bacteria and viruses reproduce more slowly at higher temperatures, and certain immune cells work more effectively in a warmer environment. Fever is, in most cases, your body doing exactly what it’s supposed to do.

Infections: The Most Common Trigger

The vast majority of fevers are caused by infections. Almost any bacterial pathogen can produce a febrile illness, from common culprits like strep throat and urinary tract infections to deeper, harder-to-detect problems like bone infections, hidden abscesses, or infections of the heart valves. Some bacterial infections are slow-burning and subtle. Tuberculosis, for instance, can cause prolonged fever driven more by the immune response than by the number of bacteria present, which is one reason it can be difficult to diagnose quickly.

Viral infections are an even more frequent cause of fever in everyday life. The common cold, influenza, COVID-19, and stomach viruses all routinely raise body temperature. Infections caused by Epstein-Barr virus or cytomegalovirus (the viruses behind mono) can occasionally produce fevers lasting several weeks.

Fungal infections are a less common but important cause, particularly in certain geographic regions. Fungi like Histoplasma and Coccidioides can cause lung or body-wide infections that produce chronic fevers, sometimes in otherwise healthy people. Parasitic infections, including malaria and leishmaniasis, are significant causes of prolonged fever in tropical regions.

Non-Infectious Causes

Not every fever means you have an infection. Several categories of conditions can trigger the same immune signaling cascade without any virus or bacterium involved.

Autoimmune and Autoinflammatory Conditions

In autoimmune diseases like lupus and rheumatoid arthritis, the immune system mistakenly attacks healthy tissue, producing inflammation and often fever. Autoinflammatory diseases are a separate group of disorders in which the innate immune system (your body’s first-line defense) misfires on its own, causing recurring fevers that come and go in patterns. These conditions are often genetic and tend to appear in childhood. The most common include familial Mediterranean fever and a condition called PFAPA, which causes periodic episodes of fever, mouth sores, and sore throat in young children.

Cancer

Certain cancers, particularly lymphomas and leukemias, can cause persistent or recurring fevers. Tumor cells can release inflammatory signaling molecules directly, or the immune system’s ongoing response to the cancer produces enough inflammation to raise body temperature. An unexplained fever lasting weeks, especially when accompanied by night sweats and unintentional weight loss, is one of the classic warning signs that prompts doctors to investigate further.

Medication Reactions

Drug-induced fever is more common than many people realize, and it can be tricky to identify because the fever looks identical to one caused by infection. The underlying mechanism is typically an immune hypersensitivity reaction to the drug itself. Antibiotics are among the most frequent offenders, particularly penicillin-family drugs and cephalosporins. But the list extends well beyond antibiotics to include seizure medications like phenytoin and carbamazepine, heart and blood pressure drugs, common anti-inflammatory painkillers like ibuprofen and naproxen, and even some immunosuppressant drugs. The fever usually resolves within 48 to 72 hours of stopping the responsible medication.

Fever vs. Overheating

There is an important distinction between a true fever and hyperthermia (overheating from external heat). In a fever, your brain deliberately raises the temperature set point and your body works to reach it. In heat stroke, your body’s cooling system fails entirely, and your core temperature climbs out of control, potentially reaching 106°F or higher within 10 to 15 minutes. The sweating mechanism shuts down, and the brain has not chosen this temperature increase.

This distinction matters because the treatments are different. Fever responds to medications that block prostaglandin production, which lowers the set point back to normal. Heat stroke does not respond to those medications because the thermostat was never deliberately raised. Heat stroke requires rapid external cooling and is a medical emergency.

When Fever Lasts Weeks Without an Answer

Most fevers resolve in a few days as the underlying infection clears. But when a fever of 101°F (38.3°C) or higher persists for three weeks or more and standard testing hasn’t identified a cause, it meets the clinical definition of fever of unknown origin. The causes in these cases break down roughly into three categories: hidden infections (such as tuberculosis, deep abscesses, or heart valve infections), autoimmune or inflammatory conditions, and cancers. In a meaningful percentage of cases, the fever eventually resolves on its own and no cause is ever identified.

Why the Fever Itself Feels So Bad

The discomfort you feel during a fever, including the aches, fatigue, chills, and loss of appetite, is not caused by the higher temperature alone. Those symptoms come largely from the same inflammatory signaling molecules that triggered the fever in the first place. Interleukin-1 and interleukin-6 affect muscle tissue, energy levels, and appetite as part of a broader “sickness behavior” response that essentially forces you to rest so your body can redirect energy toward fighting the threat. The chills you feel at the onset of a fever are your body’s way of generating heat through shivering to close the gap between your current temperature and the new, higher set point. Once your temperature reaches that set point, the chills typically stop, and you may actually feel hot or begin sweating as the fever starts to break and the set point returns to normal.