Cleveland Clinic logo
Search

Pneumonia

Medically Reviewed.Last updated on 04/16/2026.

Pneumonia is inflammation and fluid in your lungs caused by a bacterial, viral or fungal infection. It makes it difficult to breathe and can cause a fever and cough with yellow, green or bloody mucus. The flu, COVID-19 and pneumococcal disease are common causes of pneumonia. Treatment depends on the cause and severity.

What Is Pneumonia?

Anatomy of healthy lungs and ones with pneumonia, with inflamed, fluid-filled alveoli and airways
Pneumonia causes your lung tissue to swell. It can cause fluid or pus in your lungs.

Pneumonia is an infection that causes inflammation and fluid in the small air sacs of your lungs (alveoli). Bacteria, viruses or fungi can cause it. Bacterial pneumonia is usually more severe than viral pneumonia. Viral pneumonia often gets better on its own.

Advertisement

Cleveland Clinic is a non-profit academic medical center. Advertising on our site helps support our mission. We do not endorse non-Cleveland Clinic products or services. Policy

Pneumonia (pronounced “noo-MOHN-yuh”) can develop when your immune system attacks an infection in your alveoli. This causes your lungs to swell and leak fluids.

You can get pneumonia in one or both lungs. Pneumonia in both lungs is called bilateral or double pneumonia.

Types

You might hear pneumonia defined by where you got the infection. Types include:

  • Community-acquired pneumonia (CAP): This is pneumonia you get during your daily life (when you’re not staying in a healthcare facility). Causes include bacteria, viruses, fungi and, rarely, parasites.
  • Hospital-acquired pneumonia (HAP): You can get HAP while in a hospital or healthcare facility for another illness or procedure. HAP is usually more serious than community-acquired pneumonia because antibiotic-resistant bacteria, like methicillin-resistant Staphylococcus aureus (MRSA), are more likely to cause it.
  • Healthcare-associated pneumonia (HCAP): You can get HCAP while in a long-term care facility (such as a nursing home) or outpatient, extended-stay clinics. Antibiotic-resistant bacteria usually cause it.
  • Ventilator-associated pneumonia (VAP): If you need to be on a respirator or breathing machine to help you breathe in the hospital, you’re at risk for ventilator-associated pneumonia (VAP). Bacteria, including antibiotic-resistant bacteria, cause VAP.

Advertisement

You might hear the type of pneumonia described by certain causes, too. These could include:

  • Bacterial pneumonia: Pneumonia you get from bacteria, like Streptococcus pneumoniae or Legionella.
  • Viral pneumonia: Pneumonia you get from a virus, like cold or flu viruses.
  • Aspiration pneumonia: Aspiration is when solid food, liquids, spit or vomit go down your trachea (windpipe) and into your lungs. If you can’t cough these up, your lungs can get infected.
  • Lipoid pneumonia: This happens when the air sacs in your lungs fill with oily substances.

Symptoms and Causes

Symptoms of pneumonia include high fever, cough, fatigue, shortness of breath, sweating or chills, rapid heartrate and more.
You won’t necessarily have all the symptoms of pneumonia. Symptoms may be different in young children and older adults.

Symptoms of pneumonia

Symptoms of pneumonia can range from mild to severe and sometimes depend on the cause. They include:

  • High fever (up to 105 degrees Fahrenheit or 40 degrees Celsius)
  • Cough with yellow, green or bloody mucus
  • Tiredness (fatigue) or weakness
  • Rapid breathing or shortness of breath
  • Rapid heart rate
  • Sweating or chills
  • Chest pain and/or abdominal pain, especially with coughing or deep breathing
  • Loss of appetite
  • Bluish skin, lips or nails (cyanosis)
  • Confusion or altered mental state

Viral pneumonia can also cause dry cough, headache or muscle pain. Symptoms of viral pneumonia usually develop over several days. Symptoms of bacterial pneumonia can develop gradually or suddenly.

Symptoms may appear differently in babies and young children. If you’re over 65 or have a weakened immune system, you may have mild or less noticeable symptoms. Ongoing health conditions may get worse.

Pneumonia causes

Many bacteria, viruses and fungi can cause infections that lead to pneumonia. Adults are most likely to get pneumonia from bacteria. School-aged kids are most likely to get it through a viral infection.

Common causes of pneumonia include:

Less common causes of pneumonia include:

  • Fungal infections, like CryptococcusPneumocystis jirovecii and Coccidioides (Valley fever)
  • Toxoplasmosis and other protozoal infections
  • Antibiotic-resistant bacterial infections, like MRSA, Klebsiella pneumoniae, Serratia marcescens and Pseudomonas aeruginosa, can cause hospital-related pneumonia

Is pneumonia contagious?

Pneumonia itself isn’t contagious. But the bacteria and viruses that cause it are. For example, many viral infections, like the flu, colds and COVID-19, can lead to inflammation in your lungs. They’re also all contagious. But most people who get viral infections don’t get pneumonia.

Advertisement

On the other hand, some contagious infections, like pneumococcal disease, often cause pneumonia. Fungal infections that cause pneumonia aren’t contagious.

Risk factors

You’re at higher risk for pneumonia if you:

  • Are over the age of 65 and or under the age of 2
  • Have a lung or heart condition, like cystic fibrosis, asthma, COPD or pulmonary fibrosis
  • Have a neurological condition that makes swallowing difficult, which can increase your risk of aspiration pneumonia
  • Are in the hospital or at a long-term care facility
  • Smoke
  • Are pregnant
  • Have a weakened immune system

Complications

Pneumonia can lead to serious complications, including:

Diagnosis and Tests

How doctors diagnose pneumonia

To diagnose pneumonia, a healthcare provider will ask about your health history and examine you. They’ll listen to your lungs with a stethoscope.

Your provider may get additional tests or imaging to help diagnose pneumonia and its cause. These could include:

  • Imaging: Your provider uses a chest X-ray or CT scan to take pictures of your lungs to look for signs of infection.
  • Blood tests: Your provider uses a blood test to help determine the type of infection.
  • Sputum test: You’re asked to cough and then spit into a container to collect a sample. A lab will look at the sample for signs of an infection and try to determine what’s causing the infection.
  • Pulse oximetry: A sensor measures the amount of oxygen in your blood to give your provider an idea of how well your lungs are working.
  • Pleural fluid culture: Your provider uses a thin needle to take a sample of fluid from around your lungs. A lab tries to grow bacteria or fungi from the sample to determine what’s causing the infection.
  • Arterial blood gas test: Your provider takes a blood sample from your wrist, arm or groin to measure oxygen levels in your blood to know how well your lungs are working.
  • Bronchoscopy: In some cases, your provider may use a thin, lighted tube called a bronchoscope to look at the inside of your lungs. They may also take tissue or fluid samples to be tested in a lab.

Advertisement

Sometimes, a provider might not be able to find the exact cause.

Management and Treatment

How is pneumonia treated?

Treatment for pneumonia depends on the cause and how serious the inflammation is. If a provider can’t determine the cause, treatment will focus on managing symptoms and making sure your condition doesn’t get worse.

Some treatments could include:

  • AntibioticsAntibiotics treat bacterial pneumonia. They can’t treat a virus, but a provider may prescribe them if you have a bacterial infection at the same time as a viral infection.
  • Antifungal medicationsAntifungals can treat pneumonia from a fungal infection.
  • Antiviral medications: Providers usually don’t treat viral pneumonia with medication. They may prescribe antivirals to help reduce how long you’re sick. Antivirals may also reduce the severity of illness.
  • Oxygen therapy: If you’re not getting enough oxygen, your provider may give you extra oxygen through a tube in your nose or a mask on your face.
  • IV fluids: To treat or prevent dehydration, your provider may give you fluids directly in a vein (IV).
  • Draining fluids: If you have a lot of fluid around your lungs, your provider may drain it. This is done with a catheter or surgery.

If you have severe pneumonia, you may need to stay in the hospital for treatment. You’re more likely to be hospitalized for pneumonia if you’re:

Advertisement

  • Under age 2 or over age 65
  • Have a weakened immune system
  • Have health conditions that affect your heart and lungs

At-home treatments

If your provider says it’s OK to recover at home, over-the-counter medications and other at-home treatments can help you manage the symptoms. These include:

  • Pain relievers and fever reducers: Your provider may recommend medicines like ibuprofen (Advil®) and acetaminophen (Tylenol®) to help with body aches and fever.
  • Breathing treatments and exercises: Your provider may prescribe these treatments to loosen mucus and help you breathe.
  • Humidifiers: Keeping a humidifier running by your bed or taking a steamy shower or bath may make it easier to breathe.
  • Fluids: Drinking plenty of fluids can help you clear mucus out and keep you well-hydrated.
  • Cough suppressants: Check with your healthcare provider before taking cough suppressants for pneumonia. Coughing is important to help clear your lungs.

When should I see my healthcare provider?

Pneumonia can be life-threatening if left untreated, especially if you have an underlying health condition. Contact a healthcare provider if you have these symptoms, especially if they’re new or getting worse:

  • Shortness of breath
  • High fever
  • Cough with mucus
  • Tiredness
  • Feeling less hungry without reason

Go to the emergency room or call 911 if you:

  • Struggle to breathe or are short of breath while sitting still
  • Have new or worsening chest pain
  • Are confused or can’t think clearly

Outlook / Prognosis

How soon after treatment will I feel better?

How soon you’ll feel better depends on:

  • Your age
  • The cause of pneumonia
  • How sick you are
  • If you have other health conditions or complications

Most symptoms of bacterial pneumonia usually start to get better within a day or two after starting treatment. Some symptoms, like cough and fatigue, may linger for several weeks. It may take six to eight weeks to feel back to normal if you’ve been hospitalized.

You may have lingering health issues after recovery. You might notice:

  • Trouble with physical activity, like shortness of breath or reduced stamina
  • Worsening of cardiovascular disease
  • General decline in quality of life

Children who’ve recovered from pneumonia have an increased risk of chronic lung diseases.

Follow up with your healthcare provider if you have ongoing health concerns after recovering.

Can pneumonia go away on its own?

Viral pneumonia often goes away on its own. But you should always have a healthcare provider check you out. Some cases of pneumonia can be serious, especially if bacteria cause it. Bacterial pneumonia is best treated with antibiotics. The only way to know the difference is to see a provider.

How long am I contagious?

If you have bacterial pneumonia, you’re no longer considered contagious when your fever is gone and you’ve been on antibiotics for at least two days. If you have viral pneumonia, you’re likely to be contagious until you feel better and have been fever-free for several days.

How can I prevent pneumonia?

The best way to prevent pneumonia is to get vaccinated against bacteria and viruses that commonly cause it. These vaccines won’t protect against all types of pneumonia, but if you do get sick, it’s less likely to be severe. Your healthcare provider can recommend which vaccines make sense for you or your loved ones.

Vaccines that can reduce your risk of pneumonia include:

  • Pneumococcal vaccines: There are several vaccines against pneumococcal disease. They’re each recommended for certain age groups or those with increased risk for pneumonia.
  • Vaccinations against viruses: Getting vaccinated against viruses that can lead to pneumonia, like COVID-19 and the flu, can help reduce your risk.
  • Childhood vaccinations: Several childhood vaccines help prevent infections that can lead to pneumonia.

There are also everyday precautions you can take to help reduce your risk of getting and spreading pneumonia:

  • Quit smoking and avoid secondhand smoke. Smoking damages your lungs and makes you more likely to get an infection.
  • Don’t vape. Vaping increases your risk of lipoid pneumonia.
  • Wash your hands with soap and water before eating, before and after handling food, and after using the restroom. If soap isn’t available, use an alcohol-based hand sanitizer.
  • Avoid close contact and sharing items with other people if either of you has a contagious disease, such as the flu, a cold or COVID-19.
  • If you have to stay in a hospital or other healthcare facility, don’t hesitate to ask your providers about how to reduce your risk of getting an infection during your stay.
  • Get treated for any other infections or health conditions you may have. These conditions could weaken your immune system, which could increase your chance of pneumonia.
  • Avoid excessive alcohol consumption. Talk to a healthcare provider if you’re concerned about how much alcohol is safe.

Additional Common Questions

What’s the difference between viral and bacterial pneumonia?

Bacterial pneumonia tends to be more common and more severe than viral pneumonia. It’s more likely to require a hospital stay. Providers treat bacterial pneumonia with antibiotics. Viral pneumonia causes flu-like symptoms and is more likely to resolve on its own. You usually don’t need specific treatment for viral pneumonia.

A note from Cleveland Clinic

When you’re sick with respiratory symptoms, you may wonder: Is it just a cold or could it be pneumonia? It can be worrying if you’re not sure if something more serious might be going on. A high fever, bloody or unusually colored mucus, chest pain and shortness of breath are symptoms you shouldn’t ignore. Don’t hesitate to get medical attention when your body is telling you that something isn’t right.

Cleveland Clinic icon
Health Essentials logo
Subscription icon

Better health starts here

Sign up for our Health Essentials emails for expert guidance on nutrition, fitness, sleep, skin care and more.

Experts You Can Trust

Medically Reviewed.Last updated on 04/16/2026.

Learn more about the Health Library and our editorial process.

References

Cleveland Clinic’s health articles are based on evidence-backed information and review by medical professionals to ensure accuracy, reliability and up-to-date clinical standards.

Care at Cleveland Clinic

Need care fast? Cleveland Clinic’s Express Care and Urgent Care locations treat everything from sprains to sinus infections — no appointment needed.

Ad