What's the difference between a bacterial infection and a viral infection?

Answer From Pritish K. Tosh, M.D.

Bacteria cause bacterial infections. Viruses cause viral infections. Antibiotic medicines kill or keep many bacteria from growing but don't treat viruses. Antiviral medicines help the body clear out some viruses.


Bacteria are single-celled microorganisms. They can live in many different types of environments.

Bacteria also live on and in the human body. Most bacteria cause no harm and some help. For example, bacteria in the intestines help digest food.

But bacteria can cause illness. For example, bacteria that travel from the anus into the urinary tract can cause a urinary tract infection.

People can come into contact with bacteria from other people, food or the environment. These bacteria can cause illnesses. Some examples are:

  • Strep throat.
  • Tuberculosis.
  • Salmonellosis.
  • Tetanus.

Antibiotics are medicines that kill bacteria or block activities bacteria need to live or grow.

Hundreds of antibiotics exist. But bacteria have naturally occurring genetic means to help them avoid being wiped out. The bacteria that stay alive and active after being treated with antibiotics are called antibiotic-resistant bacteria.

If disease-causing bacteria become resistant to antibiotics, treating illnesses can become harder in the future. Antibiotic resistance can mean that people are sicker for longer. Some people may even die from infections that used to be treated with antibiotics. Antibiotics are unlike other types of medicine. How a person uses an antibiotic can affect how well that antibiotic works for people in the future.

People who may rely on antibiotics more than others are those who:

  • Are planning a surgery.
  • Are getting cancer treatment.
  • Have had an organ transplant.
  • Receive dialysis.
  • Have diabetes.


Viruses are bits of genetic information, either RNA or DNA, surrounded by protein. A virus needs a living host, such as a person, plant or animal. To spread, a virus gets into a host's body and then into the host's cells. Then it takes over the host cell's machinery, using it to make more of the virus.

Diseases caused by viruses include:

  • COVID-19, caused by a coronavirus called SARS-CoV-2.
  • Chickenpox, caused by the varicella-zoster virus.
  • HIV, caused by the human immunodeficiency virus.
  • Common colds, caused by a range of viruses, but often by rhinoviruses.

Medicine that treats viral infections is called an antiviral. These medicines usually stop a virus from making copies of itself. They also may stop a virus from going into or leaving a cell.

Many antivirals are made to target the virus and not the host cell. For this reason, antiviral medicine often needs a person's immune system to help clear out the infection. Some antiviral medicines focus on boosting parts of the host's immune system.

More than 70 antiviral medicines are used to treat human illnesses, some with major effects. For example, between 1996 and 1997 when antiviral therapy was introduced to treat HIV infection, the rate of death from HIV infection decreased 47%.

Viruses have a natural ability to escape the control of antiviral medicine. But this resistance is more likely in people with weakened immune responses. A weakened immune response allows the virus to copy itself more often, for longer. That raises the chance that it will develop a resistance.

Viruses that become resistant to antivirals have affected treatment, including for genital herpes, HIV and, in 2008, for influenza (flu).

Treating and preventing bacterial and viral infections

In some cases, it can be hard to figure out if a bacterial infection or a viral infection is causing your symptoms. Both infections can cause the same diseases, such as pneumonia, meningitis and diarrhea. A careful review of your symptoms and lab tests can help your health care provider find the right treatment.

If your provider gives you a medicine, either an antibiotic or an antiviral, take it as directed. To prevent infections, get vaccinated for viral and bacterial illnesses on schedule.

Also follow these tips to prevent illness:

  • Wash your hands with soap and water.
  • Keep your hands away from the face.
  • Stay away from people who are sick and avoid others if you are sick.
  • Cover your coughs and sneezes.
  • Learn how to identify an infection.
  • Be aware of the bacteria pets can bring into your living area or get on your hands.
  • Clean and disinfect items that you touch often.
  • Follow food safety rules.
  • Take steps to prevent sexually transmitted infections.

It can help to ask your provider about your risk of infection. Also ask about your risk of a more serious response to infection called sepsis.


Pritish K. Tosh, M.D.

From Mayo Clinic to your inbox

Sign up for free and stay up to date on research advancements, health tips, current health topics, and expertise on managing health. Click here for an email preview.

To provide you with the most relevant and helpful information, and understand which information is beneficial, we may combine your email and website usage information with other information we have about you. If you are a Mayo Clinic patient, this could include protected health information. If we combine this information with your protected health information, we will treat all of that information as protected health information and will only use or disclose that information as set forth in our notice of privacy practices. You may opt-out of email communications at any time by clicking on the unsubscribe link in the e-mail.

Feb. 04, 2023 See more Expert Answers