Pneumonia: What to Know

Medically Reviewed by Poonam Sachdev on April 28, 2024
10 min read

photo of Pneumonia

Pneumonia is a lung infection that can range from mild to so serious that you have to go to the hospital. It happens when an infection causes air sacs in your lungs (the alveoli) and tubes in your airways that connect to them (bronchioles) to fill with fluid or pus. That can make it hard for you to breathe in enough oxygen.

Anyone can get this lung infection. But children younger than 2 and people over 65 are at higher risk. That’s because their immune systems might not be strong enough to fight it. Lifestyle habits, like smoking cigarettes and drinking too much alcohol, can also raise your chances of getting pneumonia.

You can get pneumonia in one or both lungs. Pneumonia in both lungs is sometimes called bilateral pneumonia or double pneumonia. You can also have pneumonia and not know it. This is sometimes called walking pneumonia.

Causes include bacteria, viruses, and fungi. If your pneumonia results from bacteria or a virus, you can spread it to someone else.

Pneumonia can be grouped into types based on what caused it. Many things can lead to pneumonia, but some of the most common are:

Bacterial pneumonia

More people get this type of pneumonia than any other. While several types of bacteria can cause it, the most common in the U.S. is streptococcus. People sometimes get bacterial pneumonia after a viral infection like a cold or the flu.

Viral pneumonia

Viruses, such as cold and flu viruses, cause about a third of all cases of pneumonia. They're the most common cause of the condition in children under 5. This type of infection isn't usually as serious as bacterial pneumonia, but it can be. Viral pneumonia raises your risk of also getting bacterial pneumonia. 

Fungal pneumonia

Fungi found in dirt or bird poop can also cause a pneumonia infection. This type is more likely to affect people with weaker immune systems, such as those who have long-lasting health problems. 

Walking pneumonia

This is a nickname for a less serious type that's officially called mycoplasma pneumonia. It's named for the bacteria that causes it. Young adults and older children most often get this type, which often doesn't require bed rest. 

Your symptoms can vary, depending on the cause of your pneumonia, your age, and your overall health. They usually develop over several days.

Common signs of pneumonia include:

  • Sharp pain in your chest or belly when you breathe or cough
  • Coughing, which usually produces phlegm or mucus
  • Fatigue
  • Loss of appetite
  • Fever, sweating, and chills
  • Nausea, vomiting, or diarrhea
  • Shortness of breath
  • A bluish tint to your lips or fingernails (It may be harder to see on darker skin tones.)
  • Fast breathing or trouble breathing
  • A fast pulse
  • Sharp or stabbing chest pain when breathing or coughing

Along with these symptoms, older adults and people with weak immune systems might be confused or have problems with thinking. They might also have a lower-than-usual body temperature.

The symptoms of viral pneumonia tend to come on slowly, and they are often mild at first. They may include:

  • Coughing
  • A fever and chills
  • A headache
  • Shortness of breath, especially during exertion

If you have trouble breathing, coughing that doesn't stop, chest pain, or a fever of 102 F or higher, see your doctor. 

Symptoms of pneumonia in babies

Babies with pneumonia may not show any symptoms. But they could seem tired or restless. They might also have a cough, fever, vomiting, or trouble breathing. It also may be hard for them to eat.

You get pneumonia when a potentially harmful substance that your body could usually fight off overwhelms your immune system and infects your lungs. 

Viruses that can lead to viral pneumonia include:

  • Influenza viruses
  • Cold viruses
  • RSV (the top cause of pneumonia in babies age 1 or younger)
  • SARS-CoV-2, which causes COVID-19 
  • Measles virus
  • Adenovirus
  • Varicella-zoster, which causes chickenpox
  • The whooping cough virus

Causes of bacterial pneumonia include:

  • The pneumococcus bacteria, the most common cause of bacterial pneumonia
  • Mycoplasma 
  • Legionella, the bacterium that causes Legionnaire's disease
  • Certain types of chlamydia bacteria

Fungal pneumonia causes include:

  • Coccidioidomycosis, the fungus that causes valley fever, which is found in parts of the Southwestern U.S.
  • Cryptococcus, found in bird poop and soil contaminated with it 
  • Histoplasmosis, which occurs in the Mississippi and Ohio River valleys.

 Aspiration pneumonia

You can get aspiration pneumonia when you breathe in a foreign substance, like vomit, saliva, or food. You're more likely to get it if something has interfered with your gag reflex, such as a brain injury or overuse of drugs or alcohol.

Is pneumonia contagious?

Bacterial and viral types of pneumonia are contagious. The germs that cause them may spread through the air when someone who is infected talks, coughs, or sneezes. You might also get pneumonia after touching a surface that has the germs on it, then touching your mouth or nose.

Can the flu turn into pneumonia?

Influenza viruses can cause pneumonia, particularly in people who have other health conditions or are at higher risk of it for another reason

Can COVID turn into pneumonia?

The virus that causes COVID-19 can lead to pneumonia. It can also make you more prone to get an infection from other types of viruses or bacteria by weakening your immune system or causing you to need a ventilator.

Hospital-acquired pneumonia

If you get pneumonia while you’re in a hospital, that’s called hospital-acquired pneumonia. It tends to be more serious, since it can be caused by antibiotic-resistant bacteria and those who get it have other health issues. You might also hear the term health care-associated pneumonia. This refers more broadly to pneumonia you catch while in any health care facility, such as a long-term care facility or dialysis center. 

Ventilator-associated pneumonia

You have ventilator-associated pneumonia if you get the infection while using a ventilator, a machine that helps you breathe. 

Community-acquired pneumonia

Most cases are what's called community-acquired pneumonia, which means you didn’t get it in a hospital.

Anybody can get pneumonia , though it most commonly affects babies and people over 65.

You're also at higher risk if you:

  • Have a condition that affects your lungs like asthma or chronic obstructive pulmonary disease (COPD)
  • Have another serious health condition like heart disease or diabetes
  • Have a weakened immune system, from a condition like AIDS, from getting chemotherapy, or if you had an organ transplant 
  • Spend time in a health care facility such as a hospital or long-term care home 
  • Have trouble swallowing
  • Use a ventilator
  • Smoke or are exposed to secondhand smoke
  • Misuse alcohol or drugs
  • Spend time in an environment in which you breathe in irritants like dust, fumes, or chemicals


Your doctor will start with questions about your symptoms and your medical history, like whether you smoke and whether you’ve been around sick people at home, school, or work. Then, they’ll listen to your lungs. If you have pneumonia, they might hear cracking, bubbling, or rumbling sounds when you breathe in.

If your doctor thinks you might have pneumonia, they’ll probably give you tests, including:

  • Blood tests to look for signs of a bacterial infection
  • A chest X-ray to find the infection in your lungs and how far it’s spread
  • Pulse oximetry to measure the level of oxygen in your blood
  • A sputum test to check the fluid in your lungs for the cause of an infection

If your symptoms started in the hospital or you have other health problems, your doctor might give you more tests, such as:

  • An arterial blood gas test to measure the oxygen in a small amount of blood taken from one of your arteries
  • A bronchoscopy to check your airways for blockages or other problems
  • A CT scan to get a more detailed image of your lungs
  • A pleural fluid culture, in which the doctor removes a small amount of fluid from the tissues around your lungs to look for bacteria that might cause pneumonia

Pneumonia vs. bronchitis

Like pneumonia, bronchitis can give you a long-lasting cough, fever, fatigue, and chest pain. You can also get pneumonia after having bronchitis. But bronchitis, which results from inflammation in the tubes that carry air to your lungs, tends to be much less serious. See your doctor if you have these symptoms so they can figure out which condition you have and how best to treat it.

Pneumonia can have several complications, including:

  • Bacteremia, in which bacteria spread into your blood. This can cause septic shock and organ failure.
  • Respiratory failure, which might mean you need to use a breathing machine while your lungs heal
  • Pleural effusion, which is fluid buildup between the layers of tissue that line your lungs and chest cavity. This fluid can also become infected.
  • A lung abscess, when a pocket of pus forms inside or around your lung
  • Acute respiratory distress syndrome (ARDS), a serious type of respiratory failure
  • Kidney failure
  • For those with heart disease, worsening heart failure or a higher risk of a heart attack

Your treatment will depend on what caused your pneumonia, how serious it is, and your overall health. Most people are able to recover at home with rest and medication.

Pneumonia medication

If you have bacterial pneumonia, you’ll get antibiotics. Make sure you take all of the medicine your doctor gives you, even if you start to feel better before you’re through with it.

If you have viral pneumonia, antibiotics won’t help. You’ll need to rest, drink a lot of fluids, and take medicine for your fever. Antiviral medications can work well against some, but not all, of the viruses that cause pneumonia.

Your doctor will prescribe antifungal medication to treat fungal pneumonia.

Atypical pneumonia treatment

Atypical pneumonia is caused by bacteria that are hard for doctors to detect with standard methods, such as mycoplasma and legionella. With a mild case, you may be able to recover with rest and self-care at home. If it's more serious, your doctor will treat it with antibiotics. 

Pneumonia nebulizer

Your doctor may prescribe a nebulizer or inhaler to you or your child to help with breathing. But this won't treat the pneumonia itself.

Hospitalization for pneumonia

If your symptoms are serious or if you have other conditions that make you more likely to have complications, your doctor may send you to the hospital. While you’re there, your doctor will probably give you fluids or antibiotics through an IV. You may need oxygen therapy or breathing treatments. And the doctors might need to drain fluid from your lungs.

How long does pneumonia last?

Depending on what type of pneumonia you have and how sick you are, it could take anywhere from a week to a month or more to recover. You'll probably feel fatigued for a month or so. Most people continue to feel tired for about a month. You need lots of rest while you're recovering, so don't try to rush it. Ask your doctor when you can return to your usual activities. Limit contact with other people while you're sick so you don't spread the germs that cause pneumonia.

Signs that pneumonia is improving

You can tell you're recovering when your symptoms improve. While you'll probably be tired for a while, you should notice:

  • Your fever lifts.
  • You produce less mucus.
  • Your chest feels better.
  • You cough less.
  • It's easier to breathe.

There are some things you can do at home to ease your symptoms and help you recover:

  • Rest is one of the most important things you can do. Stay home from work, and ask someone else to help you do things around the house, if possible.
  • Over-the-counter drugs like pain relievers can ease pain and fever. But don't take cough or cold medicines without talking to your doctor. Coughing can actually help your body get rid of an infection.
  • Drink lots of fluids, like water, warm tea, and broth, to help loosen mucus.
  • Try using a humidifier to reduce phlegm.
  • Cool compresses may help you feel better if you have a fever.
  • Don't smoke or be around smokers.
  • If your doctor has prescribed medication, take it exactly as directed.

To avoid pneumonia and the germs that can cause it, take these steps:

  • Wash your hands, thoroughly and often
  • Stay away from people who are ill. Also avoid others when you're sick.
  • If you need to cough or sneeze, do it into a tissue, your sleeve, or your elbow.
  • Frequently clean surfaces in your home or workspace that people touch a lot.
  • Don't smoke, and avoid secondhand smoke.
  • Stick to your treatment plan for any health conditions you have, such as asthma, heart disease, or diabetes. 
  • Get vaccinated against pneumonia and the flu.
  • Keep your immune system healthy by exercising, eating healthy foods, and getting enough sleep. 

Pneumonia vaccine

There are two types of vaccines that can prevent infection with the pneumococcus bacteria, the most common cause of bacterial pneumonia. They're recommended for:

  • People over 65
  • Those with long-term health conditions or weakened immune systems
  • Smokers

Children under 2, kids ages 2-5 who are at high risk for pneumonia, and those who go to group child care should also get a pneumonia vaccine.

A flu shot can also help prevent pneumonia in both kids and adults. So can vaccines that protect against:

  • COVID-19
  • Haemophilus influenzae type b (Hib), a bacteria that can cause pneumonia or meningitis
  • Measles
  • Whooping cough
  • RSV
  • Chickenpox

Pneumonia is a lung infection most often caused by bacteria or a virus. It may be mild enough that you can recover at home, or serious enough to put you in a hospital. Vaccines can protect you against pneumonia. See a doctor if you have trouble breathing, chest pain, a high fever, or a cough that doesn't go away.

What are the 4 stages of pneumonia symptoms?

Bacterial pneumonia has four stages:

  • Stage 1, congestion. In the first day or hours of infection, you may have coughing and fatigue.
  • Stage 2, red hepatization. Your symptoms worsen. Your lungs may look red in lab tests.
  • Stage 3, gray hepatization. Your lungs take on a grayish color. You still have pneumonia symptoms.
  • Stage 4, resolution. As your airways get back to normal, your symptoms ease and you begin feeling better. 

Pneumonia vaccine: How often?

Three pneumonia (pneumococcal) vaccines are widely used in the U.S.: PCV15, PCV20, and PCV23. PCV13 is an older vaccine, but it is still used occasionally. Doctors may use them for different people, depending on their age and health condition:

  • Most young children should get four doses of PCV15 or PCV20 at ages 2, 4, 6, and 12-15 months. This can be done up until almost age 5.
  • Kids 6-18 who haven't been vaccinated generally need one dose, depending on their risk factors. 
  • People over 65, and adults under 65 with risk factors for pneumonia, can get one shot of PCV20 or one each of PCV15 and PCV23. 

Your doctor can tell you how many shots you need and when.