Pneumonia is an infection that fills your lungs with fluid or pus, making it hard to breathe and get oxygen into your blood
Pneumonia happens when germs—bacteria, viruses, or fungi—get into your lungs and cause inflammation. Your lungs fill with fluid or pus instead of air. This means less oxygen reaches your bloodstream, which is why pneumonia makes you feel short of breath and exhausted. The infection can start in your upper airways and move down, or you can breathe germs directly into your lungs.
Pneumonia is not the same as bronchitis, which inflames the tubes that carry air but does not fill the lungs with fluid. It is also different from a regular cold or flu, though those viruses can sometimes lead to pneumonia as a complication. A chest X-ray or CT scan can show whether you have pneumonia, because the infected areas look different from healthy lung tissue.
Key Takeaways
- Pneumonia fills your lungs with fluid or pus, reducing the oxygen your body can absorb, which is why it causes shortness of breath and fatigue.
- Bacteria, viruses, or fungi can cause pneumonia, and the type matters because treatment differs—antibiotics work for bacterial pneumonia but not viral.
- You can catch pneumonia from breathing in germs from another person's cough or sneeze, or from germs already in your own mouth that move into your lungs.
- Symptoms include cough, fever, chest pain when breathing, and shortness of breath, and they can develop over days or come on suddenly depending on the cause.
How pneumonia develops in your lungs
Your lungs normally stay clear because your airways have defenses—tiny hairs called cilia that sweep germs out, and mucus that traps them. When you breathe in germs that are stronger than your defenses, or when your immune system is weakened, those germs can settle in your lungs and start to multiply.
Once the infection takes hold, your body's immune response causes inflammation. Blood vessels in your lungs leak fluid into the air sacs (called alveoli), filling them up. This is the body trying to fight the infection, but it also means those air sacs cannot hold air anymore. The more air sacs fill with fluid, the less oxygen you can breathe in. Severe pneumonia can fill so much of your lungs that your oxygen levels drop dangerously low.
Bacterial, viral, and fungal pneumonia
Bacterial pneumonia is usually caused by Streptococcus pneumoniae or Haemophilus influenzae. It tends to come on suddenly with high fever, thick mucus, and severe chest pain. Bacterial pneumonia responds to antibiotics, but only if you start treatment early. If left untreated, it can spread to your bloodstream.
Viral pneumonia is often caused by the flu virus, respiratory syncytial virus (RSV), or coronaviruses. It usually develops more slowly than bacterial pneumonia and causes a dry cough at first. Antibiotics do not work against viruses, so treatment focuses on rest, fluids, and letting your immune system fight it. Viral pneumonia can sometimes turn into bacterial pneumonia as a secondary infection.
Fungal pneumonia is less common and usually only happens in people with weakened immune systems—those with HIV, on immunosuppressant drugs, or who have had an organ transplant. Fungal pneumonia requires antifungal medications and can take weeks or months to clear.
Who is at higher risk
Pneumonia can happen to anyone, but certain groups face higher risk. Older adults (65 and up) have weaker immune responses. Young children under 5, especially under 2, have lungs that are still developing. People with chronic lung disease like COPD or asthma are vulnerable because their airways are already inflamed. Those with heart disease, diabetes, or a weakened immune system also get pneumonia more often and more severely.
Smoking damages the cilia in your airways, so smokers cannot clear germs as well. Recent flu or a bad cold can leave your lungs raw and more open to infection. Being hospitalized, especially on a ventilator, raises your risk because you are exposed to hospital germs and your body is already stressed. Alcohol use disorder and homelessness also increase risk because they weaken immunity and increase exposure to germs.
Symptoms and when they appear
Pneumonia symptoms vary depending on whether it is bacterial, viral, or fungal, and how severe it is. A persistent cough is almost always present—it may start dry and become wet with mucus or blood-tinged sputum. Fever is common but not always high; some people have only a low-grade fever or none at all. Shortness of breath, chest pain that gets worse when you breathe or cough, and fatigue are typical.
Viral pneumonia often starts with cold or flu symptoms—sore throat, runny nose, body aches—and the cough develops over a few days. Bacterial pneumonia usually hits harder and faster, with sudden high fever and severe chest pain. In older adults and very young children, symptoms can be subtle: confusion, loss of appetite, or just feeling very tired without an obvious cough.
Symptoms can appear within days of exposure to the germ, or it can take a week or more. If you have a cough lasting more than a week, fever, or shortness of breath, you should see a doctor. Pneumonia can get worse quickly, so waiting to see if it goes away on its own is risky.
How pneumonia is diagnosed
A doctor will listen to your lungs with a stethoscope—pneumonia often makes a crackling sound. They will ask about your cough, fever, and how long symptoms have lasted. To confirm pneumonia, they usually order a chest X-ray, which shows areas of your lungs filled with fluid or pus as white patches. A CT scan gives more detail if the X-ray is unclear or if pneumonia is severe.
Blood tests can help identify whether the cause is bacterial or viral. A sputum culture—growing a sample of mucus you cough up in a lab—can identify the exact bacteria or virus, which helps doctors choose the right antibiotic. Not every case needs all these tests; a doctor may start treatment based on symptoms and an X-ray alone, especially if you are very sick and need to start antibiotics quickly.
Pneumonia versus other respiratory infections
Bronchitis inflames the tubes that carry air (bronchi) but does not fill the lungs with fluid. You get a cough and mucus, but your oxygen levels stay normal and an X-ray looks clear. Pneumonia fills the air sacs themselves, so oxygen levels drop and the X-ray shows infiltrates.
The common cold and flu are viral infections of your upper airways—nose, throat, sinuses. They cause congestion, sore throat, and sometimes a cough, but they do not cause the shortness of breath or low oxygen that pneumonia does. However, flu can lead to pneumonia as a complication, which is why people with flu symptoms that get worse after a few days should be checked for pneumonia.
Asthma causes wheezing and shortness of breath but is not an infection. Asthma flares up when airways tighten; pneumonia happens when germs fill your lungs with fluid. A person can have both at the same time, which makes breathing even harder.
Frequently Asked Questions
Can you catch pneumonia from someone else?
You can catch the germs that cause pneumonia—bacteria, viruses, or fungi—from another person's cough or sneeze. However, not everyone who breathes in those germs will develop pneumonia. Your immune system, age, and overall health determine whether the germs take hold. You are most contagious in the first few days of illness.
Is pneumonia always serious?
Pneumonia ranges from mild to life-threatening. "Walking pneumonia" is a mild viral or bacterial infection where you stay functional and do not need hospitalization. Severe pneumonia can cause sepsis, organ failure, and death, especially in older adults or those with weak immune systems. Any pneumonia needs medical attention to prevent it from worsening.
How long does pneumonia last?
Mild viral pneumonia may clear in one to three weeks with rest and fluids. Bacterial pneumonia treated with antibiotics usually improves within a few days of starting medication, though a cough can linger for weeks. Severe pneumonia or fungal pneumonia can take months to fully resolve. Recovery depends on the cause, your age, and your overall health.
Can pneumonia come back?
Yes, you can get pneumonia more than once. Having pneumonia once does not make you immune. People with chronic lung disease, weakened immune systems, or who smoke are at risk for repeated infections. A vaccine can lower your risk of pneumonia caused by Streptococcus pneumoniae and the flu virus.
What happens if pneumonia is not treated?
Untreated pneumonia can spread to your bloodstream (sepsis), cause fluid to build up around your lungs (pleural effusion), or lead to respiratory failure where your lungs cannot deliver enough oxygen. Bacterial pneumonia is especially dangerous untreated. Even mild pneumonia should be evaluated by a doctor to rule out serious complications.