The antibiotic your doctor prescribes depends on what caused your pneumonia and how sick you are

Bacterial pneumonia is treated with antibiotics, but there is no single antibiotic that works for everyone. The choice depends on which bacteria infected your lungs, whether you caught it in the community or in a hospital, how severe your symptoms are, and whether you have other health conditions. Your doctor may start you on a broad-spectrum antibiotic (one that kills many types of bacteria) while waiting for test results, then switch to a narrower one once they know which bacteria you have.

Not all pneumonia is bacterial—viral pneumonia does not respond to antibiotics at all, and fungal pneumonia requires different drugs entirely. Your doctor will determine the cause through a chest X-ray and sometimes a sputum culture (a sample of mucus from your lungs) before deciding on treatment.

Key Takeaways

  • Community-acquired pneumonia in adults is often treated with amoxicillin-clavulanate, azithromycin, or fluoroquinolones like levofloxacin, depending on severity and risk factors.
  • Hospital-acquired pneumonia typically requires stronger antibiotics such as piperacillin-tazobactam or carbapenems because the bacteria are often resistant to common drugs.
  • Your doctor may start broad-spectrum antibiotics before culture results come back, then narrow the choice once they know which bacteria caused your infection.
  • Finishing the full course of antibiotics—even if you feel better—is essential to prevent the infection from returning or developing antibiotic resistance.
  • Allergies, kidney function, and other medications you take all affect which antibiotic is safe for you.

Common antibiotics for community-acquired pneumonia

Amoxicillin-clavulanate (Augmentin) is often the first choice for mild to moderate pneumonia in people without serious risk factors. It covers the most common bacteria—Streptococcus pneumoniae and Haemophilus influenzae—and is taken by mouth. The clavulanate component prevents some bacteria from breaking down the amoxicillin, making it effective against resistant strains.

Azithromycin (Zithromax) is a macrolide antibiotic used for mild pneumonia or as part of combination therapy for moderate cases. It is taken by mouth and covers atypical bacteria like Mycoplasma and Chlamydia, which sometimes cause pneumonia that does not respond to penicillin-based drugs. A typical course is five days.

Fluoroquinolones—particularly levofloxacin (Levaquin) and moxifloxacin (Avelox)—are broad-spectrum antibiotics taken by mouth and cover both typical and atypical bacteria. They are often used for moderate to severe pneumonia or in people with underlying lung disease like COPD. These are stronger drugs and are usually reserved for cases where simpler antibiotics are not suitable.

Ceftriaxone and cefotaxime are cephalosporin antibiotics given by injection and used for more severe pneumonia or when a patient cannot take medication by mouth. They cover a wide range of bacteria and are often given in a hospital or urgent care setting.

Antibiotics for hospital-acquired and severe pneumonia

Pneumonia caught in a hospital or nursing home is treated differently because the bacteria are often resistant to common antibiotics. Piperacillin-tazobactam (Zosyn) is a broad-spectrum injectable antibiotic frequently used as a first-line treatment for hospital-acquired pneumonia. It covers many resistant gram-negative bacteria and some anaerobes.

Carbapenems—such as meropenem (Merrem) and imipenem-cilastatin (Primaxin)—are reserved for serious infections or when resistance is suspected. These are among the strongest antibiotics available and are given by injection in a hospital setting.

Vancomycin is used when methicillin-resistant Staphylococcus aureus (MRSA) is suspected or confirmed. It is given by injection and requires blood tests to monitor levels, as the dose must be carefully controlled.

Severe pneumonia in any setting may require combination therapy—two or more antibiotics given together—to cover multiple possible bacteria while culture results are pending. Once the specific bacteria is identified, the regimen is often narrowed to a single targeted drug.

How doctors choose which antibiotic to use

Your doctor considers several factors when selecting an antibiotic. The setting matters: pneumonia caught at home is treated differently from pneumonia caught in a hospital. Your age, smoking status, and underlying conditions (such as diabetes, heart disease, or kidney disease) affect which bacteria are most likely and which drugs are safest for you.

Severity is critical. Mild pneumonia may be treated at home with oral antibiotics; moderate to severe pneumonia usually requires hospitalization and injectable antibiotics. Your doctor will also ask about drug allergies—particularly penicillin and cephalosporin allergies, since these are common and affect many first-line choices.

Recent antibiotic use matters too. If you took antibiotics in the past few months, you may have resistant bacteria, and your doctor will choose a different class of drug. Blood cultures and sputum cultures, if available, guide the choice toward the most effective antibiotic for your specific infection.

Why finishing the full course matters

Antibiotics work by killing bacteria, but they do not kill all bacteria instantly. If you stop taking the antibiotic as soon as you feel better—usually after three to five days—some bacteria survive and can multiply again, causing the infection to return. This is called relapse, and it is more serious than the original infection because the bacteria may now be resistant to the antibiotic you already took.

Stopping early also contributes to antibiotic resistance in the broader population. When bacteria survive an incomplete course of antibiotics, they pass resistance genes to other bacteria, making those drugs less effective for everyone. Your doctor will tell you how long to take the antibiotic—typically seven to ten days for community-acquired pneumonia, sometimes longer for hospital-acquired cases—and you should complete the full course even if symptoms improve.

Side effects and when to contact your doctor

Common side effects of pneumonia antibiotics include nausea, diarrhea, and rash. Diarrhea can be a sign of a serious infection called Clostridioides difficile (C. difficile), especially if it is severe or bloody. Contact your doctor if diarrhea develops or worsens during or shortly after antibiotics.

Allergic reactions range from mild rash to severe anaphylaxis. If you develop hives, swelling of the face or throat, or difficulty breathing, seek emergency care immediately. Tell your doctor about any previous allergic reactions to antibiotics, even mild ones, before starting treatment.

Some antibiotics interact with other medications or affect how your body processes them. Fluoroquinolones can increase the risk of tendon rupture, especially in older adults. Vancomycin requires blood tests to ensure levels are safe. Always tell your doctor about all medications and supplements you take.

What happens if the first antibiotic does not work

If you do not improve after two to three days on an antibiotic, your doctor may switch to a different one. This can happen if the bacteria is resistant to the first choice, if the diagnosis was wrong (for example, if the pneumonia is viral, not bacterial), or if a second infection developed. Your doctor may order repeat imaging or cultures to guide the change.

Sometimes pneumonia caused by atypical bacteria (Mycoplasma, Legionella, or Chlamydia) does not respond to standard antibiotics and requires a macrolide or fluoroquinolone instead. If you have risk factors for fungal pneumonia—such as a weakened immune system—antifungal drugs may be needed rather than antibiotics.

Frequently Asked Questions

Can I take over-the-counter antibiotics for pneumonia?

No. Antibiotics are prescription-only drugs because they must be chosen based on the type of pneumonia and your individual health situation. Taking the wrong antibiotic or the wrong dose can delay recovery and promote resistance. You need a doctor's evaluation and prescription.

What if I am allergic to penicillin?

Your doctor has several alternatives. Fluoroquinolones, macrolides, and cephalosporins (if your allergy was not severe) are options for community-acquired pneumonia. Tell your doctor the exact nature of your allergy—rash, anaphylaxis, or other reaction—because some people tolerate cephalosporins safely even with a mild penicillin rash.

How long does it take for antibiotics to work?

Most people feel better within two to three days of starting antibiotics, though fever may take longer to resolve. Fatigue and cough can persist for weeks even after the infection is gone. If you do not improve after three days, contact your doctor rather than stopping the antibiotic on your own.

Can pneumonia come back after antibiotics?

Yes, if you stop antibiotics early or if the original infection was not fully treated. Rarely, a different bacteria causes a second infection. If pneumonia returns within a few weeks, tell your doctor, as you may need a different antibiotic or further testing to find an underlying cause.

Do I need antibiotics if my pneumonia is viral?

No. Viral pneumonia does not respond to antibiotics and will resolve on its own with supportive care—rest, fluids, and fever management. However, your doctor may prescribe antibiotics if there is a risk of bacterial superinfection, particularly in older adults or people with weakened immune systems.