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 have tiny air sacs called alveoli. Normally, oxygen passes through these sacs into your bloodstream. When you have pneumonia, these air sacs fill with fluid or pus instead of air. That means less oxygen reaches your blood, which is why you feel short of breath and tired.
Pneumonia is not the same as bronchitis, which affects the tubes that carry air to your lungs. Pneumonia affects the air sacs themselves. It can develop on its own or after another illness like the flu or a cold. Some people recover in a few weeks with treatment. Others, especially older adults or people with other health conditions, can become seriously ill.
Key Takeaways
- Pneumonia fills the air sacs in your lungs with fluid or pus, blocking oxygen from reaching your blood.
- Bacteria, viruses, or fungi cause pneumonia, and different types spread and respond to treatment differently.
- Symptoms include cough, fever, chest pain, and shortness of breath, and they can develop suddenly or gradually.
- Risk is higher if you are over 65, have a chronic illness, smoke, or have a weakened immune system.
- A doctor can diagnose pneumonia with a chest X-ray and can prescribe antibiotics if bacteria is the cause.
How pneumonia develops: the step-by-step process
Pneumonia usually starts when you breathe in germs. Your lungs have defenses—mucus, cilia (tiny hairs that sweep debris out), and white blood cells—that normally catch and kill invaders. But if those defenses are weakened or overwhelmed, the germs settle in and multiply.
Once the infection takes hold, your immune system fights back, causing inflammation. That inflammation is what makes the air sacs fill with fluid or pus. Your body is trying to trap and kill the germs, but the side effect is that those sacs can no longer hold air. The more sacs that fill, the less oxygen your lungs can transfer to your blood. That is why you start coughing—your body is trying to clear the fluid—and why you feel short of breath.
The whole process can happen fast. Some people feel fine one day and very sick the next. Others develop symptoms gradually over several days. How quickly it progresses depends on which germ is causing it, how many germs you breathed in, and how strong your immune system is.
Bacterial, viral, and fungal pneumonia: what the difference means
Bacterial pneumonia is often caused by a germ called Streptococcus pneumoniae. It tends to come on suddenly with high fever, shaking chills, and a cough that brings up greenish or bloody mucus. Bacterial pneumonia usually responds to antibiotics, which kill the bacteria. Without treatment, it can become serious quickly.
Viral pneumonia is usually caused by the same viruses that cause colds and flu. It often develops more slowly and causes a dry cough, body aches, and fatigue. Antibiotics do not work against viruses, so treatment focuses on rest, fluids, and managing symptoms while your immune system fights the infection. Viral pneumonia can sometimes lead to bacterial pneumonia as a secondary infection.
Fungal pneumonia is less common and usually only serious in people with very weak immune systems, such as those with untreated HIV or people taking strong immunosuppressant drugs. It develops slowly and can be hard to diagnose. Treatment requires antifungal medications, which are different from antibiotics.
Knowing which type you have matters because treatment is different. That is why a doctor will often order tests to figure out what is causing your pneumonia before prescribing medication.
Symptoms that signal pneumonia rather than a cold or flu
Pneumonia symptoms overlap with cold and flu symptoms, which is why people sometimes miss it. The key difference is that pneumonia symptoms are often more severe and focus on your chest and breathing.
Common pneumonia symptoms include a cough (often with mucus), fever, chills, shortness of breath, chest pain that gets worse when you breathe or cough, fatigue, and sometimes nausea or diarrhea. In older adults, symptoms can be less obvious—they might just feel confused, very tired, or have a lower-than-normal temperature instead of a high fever.
If you have a cough that lasts more than a week, or if you develop chest pain or shortness of breath, contact your doctor. These are signs that something more serious than a simple cold might be happening. Do not wait to see if it goes away on its own.
Who is at higher risk for pneumonia
Anyone can get pneumonia, but some people are more likely to become seriously ill. Age is one factor—adults over 65 have a harder time fighting off the infection. People with chronic illnesses like heart disease, diabetes, or chronic obstructive pulmonary disease (COPD) are at higher risk. Smokers are also more vulnerable because smoking damages the lungs' natural defenses.
People with weakened immune systems—including those with HIV, those taking immunosuppressant medications after an organ transplant, or those undergoing chemotherapy—are at serious risk. Recent surgery or hospitalization also increases risk because germs in hospitals can be harder to fight. Alcohol use disorder and homelessness are risk factors too, partly because they make it harder for the body to fight infection and partly because of exposure to germs in crowded settings.
If you fall into any of these groups and develop symptoms, tell your doctor about your risk factors. They may monitor you more closely or treat you more aggressively.
How doctors diagnose pneumonia
Your doctor will start by listening to your lungs with a stethoscope. Pneumonia often makes a crackling or bubbling sound. They will ask about your symptoms, how long you have had them, and whether you have been around anyone who was sick.
A chest X-ray is the standard test for pneumonia. It shows areas of your lungs that are filled with fluid or pus, which look white or cloudy on the image. An X-ray can also show whether the infection is in one part of your lung or spread throughout.
Your doctor may also order blood tests or a sputum culture (a test of the mucus you cough up) to figure out which germ is causing the pneumonia. This helps them choose the right treatment. In some cases, especially if you are very sick or hospitalized, they might order a CT scan to get a more detailed picture.
Treatment depends on what is causing your pneumonia
If bacteria is causing your pneumonia, your doctor will prescribe antibiotics. It is important to take the full course even if you start feeling better after a few days. Stopping early can allow the infection to come back or develop resistance to the medication.
If a virus is causing it, antibiotics will not help. Instead, treatment focuses on supporting your body while it fights the infection: rest, drinking plenty of fluids, using a humidifier to ease coughing, and over-the-counter fever reducers if needed. Your doctor may prescribe an inhaler to help open your airways if you are having trouble breathing.
Most people recover at home with outpatient care. But if you are very sick, have trouble breathing, are over 65, or have other serious health conditions, your doctor may recommend hospitalization. In the hospital, you can receive oxygen, intravenous fluids, and close monitoring.
Frequently Asked Questions
Can pneumonia turn into something worse if I do not treat it?
Yes. Untreated pneumonia can lead to sepsis (a life-threatening blood infection), respiratory failure (when your lungs cannot get enough oxygen into your blood), or a lung abscess (a pocket of pus in the lung). This is why it is important to see a doctor if you have symptoms, especially if you are in a high-risk group.
Is pneumonia contagious?
It depends on the cause. Viral pneumonia spreads through respiratory droplets, so you can catch it from someone who is coughing or sneezing. Bacterial pneumonia is less contagious but can still spread. Fungal pneumonia is not contagious between people. If you have pneumonia, stay home and away from others until you have been on antibiotics for at least 24 hours or your symptoms improve significantly.
Can you get pneumonia more than once?
Yes. Having pneumonia once does not make you immune. You can get it again from a different germ or even the same type. People with chronic lung disease or weakened immune systems are at higher risk for recurrent pneumonia. Vaccines can lower your risk of certain types of bacterial pneumonia.
How long does it take to recover from pneumonia?
Recovery time varies. Mild cases may improve in a week or two with treatment, but fatigue can linger for several weeks. Severe cases, especially in older adults or people with other health conditions, can take months to fully recover. Your doctor can tell you what to expect based on your specific situation.
What is the difference between pneumonia and pneumonitis?
Pneumonitis is inflammation of the lungs caused by inhaling irritants like dust, chemicals, or mold, rather than by infection. It is not contagious and does not involve germs. Treatment focuses on avoiding the irritant and managing inflammation, not on antibiotics.