Pneumonia is an infection that fills your lungs with fluid or pus

Pneumonia is an infection in your lungs that causes the air sacs (called alveoli) to fill with fluid or pus instead of air. This makes it harder for oxygen to reach your bloodstream. The infection can be caused by bacteria, viruses, or fungi. Some cases are mild enough to treat at home, while others require hospital care.

Pneumonia can develop on its own or after another illness like the flu or a cold. It can affect one lung or both. The severity depends on which germ caused it, how healthy you were before you got sick, and your age.

Key Takeaways

  • Pneumonia fills your lungs with fluid or pus, making it harder for oxygen to enter your blood.
  • Bacteria, viruses, or fungi can cause pneumonia, and each type is treated differently.
  • Symptoms include cough, fever, chest pain, and shortness of breath, though older adults may have fewer obvious signs.
  • Doctors diagnose pneumonia using a chest X-ray or CT scan, along with blood tests or sputum samples.
  • Treatment depends on the cause—antibiotics for bacterial pneumonia, supportive care for viral, and antifungal drugs for fungal types.

The three main types of pneumonia and what causes them

Bacterial pneumonia is the most common type in adults. Streptococcus pneumoniae is the bacterium doctors see most often, though other bacteria like Haemophilus influenzae and Legionella can also cause it. Bacterial pneumonia tends to come on suddenly and can be serious.

Viral pneumonia is often milder than bacterial pneumonia, though it can become severe. Respiratory viruses like influenza (flu), respiratory syncytial virus (RSV), and coronaviruses can all cause viral pneumonia. Viral pneumonia usually develops gradually and may follow an upper respiratory infection.

Fungal pneumonia is less common and usually affects people with weakened immune systems. Histoplasmosis and coccidioidomycosis are examples. These infections develop slowly and can be harder to diagnose.

Symptoms that suggest you might have pneumonia

The most common symptom is a cough that may produce mucus (sputum), which can be clear, yellow, greenish, or tinged with blood. You may also have a fever, chills, and chest pain that gets worse when you breathe deeply or cough. Shortness of breath is another key sign.

Some people feel very tired or have muscle aches. Nausea, vomiting, or diarrhea can occur, especially with certain types of pneumonia. Older adults may have fewer obvious symptoms—sometimes just confusion, a low temperature, or a change in how they normally function—which is why pneumonia can be missed in this group.

Symptoms usually appear within a few days of catching the infection. If you have a persistent cough, fever, or chest pain lasting more than a week, or if you feel very short of breath, contact your doctor.

How doctors diagnose pneumonia

Your doctor will start by listening to your lungs with a stethoscope. Pneumonia often produces crackling sounds or abnormal breathing patterns. They will also ask about your symptoms, when they started, and whether you have been around anyone who was sick.

A chest X-ray is the standard test to confirm pneumonia. It shows areas of your lungs filled with fluid or pus, which appear as white patches on the image. Some doctors use a CT scan instead, which gives a more detailed picture.

Your doctor may also order blood tests to check your white blood cell count and to try to identify which germ is causing the infection. If you are coughing up mucus, they may send a sample (called sputum) to the lab to identify the specific bacterium, virus, or fungus. This helps them choose the right treatment.

Treatment depends on what type of pneumonia you have

If bacteria caused your pneumonia, your doctor will prescribe antibiotics. Common choices include amoxicillin, azithromycin, or fluoroquinolones, depending on which bacteria is most likely. You usually start feeling better within a few days, but you should take the full course of antibiotics even if you feel well.

Viral pneumonia cannot be treated with antibiotics. Instead, treatment focuses on supporting your body while it fights the infection—rest, fluids, fever-reducing medication, and oxygen if needed. Some antivirals may help if caught early, depending on which virus caused it.

Fungal pneumonia requires antifungal medications, which take longer to work than antibiotics. Treatment may last weeks or months. If your immune system is very weak, your doctor may recommend preventive antifungal drugs.

Most people recover at home with rest and medication. Hospital care is needed if you have severe symptoms, very low oxygen levels, confusion, or other serious signs. Older adults and people with chronic illnesses are more likely to need hospitalization.

What happens after pneumonia treatment ends

Recovery time varies. Some people feel better within a week or two, while others take several weeks to regain their full energy. A lingering cough can last for weeks even after the infection is gone.

Your doctor may want to repeat a chest X-ray a few weeks after treatment to make sure the infection has cleared, especially if you are older or have other health conditions. If you are not improving as expected, or if symptoms return, contact your doctor right away.

To prevent pneumonia in the future, ask your doctor about pneumococcal and flu vaccines. These do not prevent all cases, but they significantly lower your risk of getting pneumonia or having a severe case.

Risk factors that make pneumonia more likely

Age matters—pneumonia is more common and more serious in people over 65 and in children under 5. Smoking damages your lungs' ability to fight infection, so smokers have higher risk. Chronic lung diseases like asthma or COPD, heart disease, and diabetes all increase your chances.

A weakened immune system from HIV, cancer treatment, or certain medications makes pneumonia more likely and potentially more severe. Recent surgery, being bedridden, or a recent respiratory infection also raise your risk. Alcohol misuse can impair your immune response.

If you have any of these risk factors and develop symptoms of pneumonia, seek medical attention promptly. Early treatment can prevent complications.

Frequently Asked Questions

Is pneumonia contagious?

The germs that cause pneumonia can spread from person to person through coughs and sneezes, but not everyone who is exposed will develop pneumonia. Your immune system and overall health determine whether you get sick. People with pneumonia should cover their cough and wash their hands to reduce spread.

Can pneumonia turn into something more serious?

Yes. Untreated or severe pneumonia can lead to sepsis (a life-threatening blood infection), respiratory failure requiring a ventilator, or fluid around the lungs (pleural effusion). This is why prompt treatment and follow-up care matter, especially for older adults and people with other health conditions.

How long does pneumonia last?

Bacterial pneumonia treated with antibiotics often improves within three to five days, though full recovery takes weeks. Viral pneumonia may take longer—sometimes two to three weeks. Fungal pneumonia can take months. A lingering cough is common and does not always mean the infection is still active.

Can you get pneumonia twice?

Yes. Having pneumonia once does not make you immune. You can catch it again from a different germ, or even the same type if your immune system has weakened. Vaccination and avoiding risk factors like smoking lower your chances of recurrence.

What is the difference between pneumonia and bronchitis?

Bronchitis inflames the tubes that carry air to your lungs but does not fill the air sacs with fluid. Pneumonia infects the air sacs themselves, making it harder for oxygen to enter your blood. Pneumonia is generally more serious and more likely to require antibiotics.