Skip to main content
Cancer Explained
Donate
Beginner 5 min readSource checked

Infections and Cancer: How Germs Can Raise Risk

An overview of how certain viruses, bacteria, and parasites can lead to cancer, including HPV, hepatitis B and C, H. pylori, EBV, and HIV

This is general education — it cannot tell you what to do in your situation.

Instructions and urgent-contact thresholds vary by treatment and care team. If you are in treatment, follow the instructions your oncology team gave you, and contact them about any new or worsening symptom. If you think you may be having a medical emergency, call your local emergency number.

NCI source

National Cancer Institute

A smiling couple selects leafy greens and fruit at an outdoor farmers market stall with a tote bag.
Shopping For Fresh Produce

Key fact

Some viruses, bacteria, and parasites can cause cancer or raise cancer risk.

The short answer

Certain infections can raise the risk of cancer. These include the viruses HPV, hepatitis B and C, EBV, and HIV, and the bacterium H. pylori. Vaccines, testing, and treatment can lower the risk from many of these infections.

  • Some viruses, bacteria, and parasites can cause cancer or raise cancer risk.

  • HPV, hepatitis B and C, and H. pylori are among the most common cancer-linked infections.

  • Infections can cause cancer by damaging cells, weakening immunity, or causing long-term inflammation.

  • Vaccines exist for HPV and hepatitis B, and can help prevent related cancers.

Choose how you want to understand this

The full explanation.

The simple version

Most cancers are not caused by germs. But some infections can raise the risk of cancer.

Certain viruses, bacteria, and parasites can lead to cancer over time. The most common ones include HPV, hepatitis B and C, and the bacterium H. pylori.

Here is the hopeful part: for many of these infections, there are ways to prevent, test for, or treat them, which lowers cancer risk.

How can an infection lead to cancer?

An infection does not turn into cancer directly. Instead, it can set the stage for cancer in a few ways.

  • Some viruses change how cells grow. They can disrupt the normal signals that keep cells in check, so cells start to grow out of control.
  • Some infections weaken the immune system. This makes the body less able to fight off other infections that can cause cancer.
  • Some infections cause long-term inflammation. Ongoing inflammation can damage cells over many years, which may lead to cancer.

For most infections, this process is slow and does not happen to everyone. Most people with these infections never develop cancer.

HPV (human papillomavirus)

HPV is a very common virus spread through intimate skin-to-skin contact. Most infections clear on their own.

But long-lasting high-risk HPV infection can cause several cancers, including nearly all cervical cancers, as well as some anal, throat, and other cancers.

The HPV vaccine can prevent infection with the types that cause most of these cancers. Cervical cancer screening also helps find and treat cell changes early.

Hepatitis B and C

Hepatitis B (HBV) and hepatitis C (HCV) are viruses that infect the liver. Long-term (chronic) infection can lead to liver cancer.

These viruses spread through blood and, for hepatitis B, through sexual contact. They can also pass from a parent to a baby at birth.

There is a safe vaccine for hepatitis B, which most babies now receive. There is no vaccine for hepatitis C yet, but treatments can cure the infection. Testing is important because these infections often cause no symptoms.

H. pylori (a stomach bacterium)

H. pylori is a bacterium that can live in the stomach lining. It is very common around the world.

Long-term infection can cause inflammation that may lead to certain types of stomach cancer. It can also cause stomach ulcers.

H. pylori can be found with a test and treated with antibiotics. Treatment can lower the risk of stomach cancer in certain people.

Other infections to know

A few other infections are linked to cancer:

  • Epstein-Barr virus (EBV): A common virus that causes mononucleosis. It is linked to certain lymphomas and nose and throat cancers. Most infected people never develop cancer.
  • HIV: This virus does not cause cancer itself. Instead, it weakens the immune system, which raises the risk of several cancers. Effective treatment is available.
  • Certain parasites: In some parts of the world, certain parasites are linked to bile duct and bladder cancers.

What you can do

You cannot control everything, but you can take helpful steps.

Practical actions include:

  • Getting recommended vaccines, such as those for HPV and hepatitis B
  • Asking your provider whether testing for any of these infections makes sense for you
  • Following treatment if you are diagnosed with an infection
  • Not sharing needles and practicing safer sex to lower the spread of some viruses

If you carry one of these infections, regular follow-up and any recommended screening can help catch problems early. Your healthcare team can guide you based on your situation.

Keeping the risk in perspective

It can be unsettling to learn that germs can play a role in cancer. But a few points help keep this in balance.

  • Most cancers are not caused by infections.
  • Most people who carry these infections never develop cancer.
  • Many of these infections can be prevented, found, or treated.

In other words, this is an area where knowledge leads to action. Unlike some cancer risk factors, infections can often be tackled head-on with vaccines, tests, and treatment.

Simple habits that help

Beyond specific tests and vaccines, some everyday habits lower the chance of spreading or catching cancer-linked infections.

Helpful habits include:

  • Getting recommended vaccines on schedule
  • Practicing safer sex to lower the spread of HPV, hepatitis B, and HIV
  • Not sharing needles or personal items that may carry blood
  • Keeping up with regular checkups and recommended screenings

None of these steps require special equipment or expense. They are part of ordinary healthy living, and they add a layer of protection.

If you are unsure which steps apply to you, your healthcare team can offer personal guidance. They can tell you which tests or vaccines make sense based on your age, history, and situation.

Words to know

Tap any term to see what it means.

Browse the full glossary →

Two women, one wearing a headscarf, sit together smiling with drinks

Common questions

How can an infection cause cancer?

Infections can lead to cancer in a few ways. Some viruses disrupt how cells grow. Some infections weaken the immune system. And some cause long-term inflammation, which over time can damage cells and lead to cancer.

Which infections are most linked to cancer?

Common ones include HPV (linked to cervical and other cancers), hepatitis B and C (liver cancer), and H. pylori (stomach cancer). EBV and HIV are also linked to certain cancers.

Are these infections common?

Yes, many are. For example, HPV and H. pylori are very common worldwide. Most people with these infections never develop cancer, but the risk is higher in some who carry the infection long-term.

Can I be vaccinated against any of these?

Yes. There are safe, effective vaccines against HPV and hepatitis B. Both can help prevent cancers linked to those infections.

How do I know if I have one of these infections?

Many of these infections cause no symptoms. Simple tests can often detect them. If you think you may be at risk, ask your healthcare provider about testing.

If I have one of these infections, will I get cancer?

No. Most people with these infections never develop cancer. Testing, treatment, and follow-up can further lower the risk. Your provider can guide you.

Questions to ask your doctor

Being prepared helps you get the most out of your appointments. Save or print these questions.

Open my question list

Tap a question to save it to your list (kept on this device).

Human Connection Layer

Speak With Trained Specialists & Human Navigators

Cancer Explained provides educational guidance, but does not replace trained specialists, social workers, or your medical team.

Free & Confidential

Talk to a trained cancer information specialist

Free, confidential assistance from NCI Cancer Information Service via phone, chat, or email.

Contact your oncology team

Locate after-hours contact numbers, portal messages, or urgent triage phone lines.

Find a patient navigator

Get one-on-one help with appointments, logistics, translation, and care coordination.

Find a genetic counselor

Discuss inherited mutation risk, family history, and genetic testing options.

Find an oncology social worker

Access emotional counseling, family support groups, and mental health resources.

Find a financial navigator

Locate copay assistance foundations, grant programs, and lodging/travel support.

Find a clinical-trial specialist

Search matching studies and speak with NCI trial information specialists.

Get urgent help

Immediate emergency guidance for fever (>100.4°F during chemo), severe pain, or shortness of breath.

Help Us Improve This Guide

Did this explanation answer your question and help you determine your next step?

Know someone who needs this?

Plenty of people are looking for something like this and do not know where to start. If this would help a friend or someone you love, send it on — we have written an opening line so you do not have to stare at an empty message. You can change every word of it.

Email itText itWhatsApp

Your message is written and sent in your own email or messaging app — we never see who you send it to, and nothing is added to any list.

Knowledge Check

0 of 4 answered

  1. Q1.According to this article, how can an infection lead to cancer?
  2. Q2.According to this article, which infections are among the most linked to cancer?
  3. Q3.According to this article, which infections can be prevented with safe, effective vaccines?
  4. Q4.According to this article, does having one of these infections mean you will get cancer?

This self-assessment checks understanding of educational content only. It is not medical advice.

Plain-language explanation of the published sources cited on this page. AI-assisted, source-checked, not clinician-reviewed.

Last updated: 2026-07-04Next planned review: 2027-07-04

How this page was created

Cancer Explained does not originate medical claims. Every page restates guidance already published by the National Cancer Institute, the CDC, the USPSTF and the FDA, in plain language, with the source cited so you can check the original yourself. AI does the translating and organizing; automated checks test claims, citations, clarity and safety before anything publishes. We do not employ clinicians and do not intend to — our work is translation and navigation, not clinical judgment. Nothing here is personal medical advice, and no page can account for your particular situation.

Editorial status — Source checked. This page was written with AI assistance and checked line by line against the sources listed on it. That confirms the sources support what the page says. It is not a medical review, and it does not confirm the page is complete or right for your situation.

High-risk topic — talk to your care team. This topic can involve urgent, individual medical decisions. This page is general education only: it cannot tell you whether your situation is an emergency or what you personally should do. Follow your oncology team's instructions and contact them for individual guidance.

Human medical review: not completed. Pages here are not signed off by a clinician before they publish. That is not an oversight we are quietly working around: we restate published guidance and cite it, so the authority belongs to the source rather than to us, and every page names where its claims come from — you can verify us instead of trusting us. Where a volunteer clinician has reviewed a page, their name and credentials appear on it; where no name appears, no clinician has checked it. We are glad to have reviewers and are recruiting them, and we do not hold pages back waiting for one. Use this site to understand your situation and to ask better questions of the people treating you.

Our editorial processHow we use AIReport an error

How this page was created

Cancer Explained does not originate medical claims. Every page restates guidance already published by the National Cancer Institute, the CDC, the USPSTF and the FDA, in plain language, with the source cited so you can check the original yourself. AI does the translating and organizing; automated checks test claims, citations, clarity and safety before anything publishes. We do not employ clinicians and do not intend to — our work is translation and navigation, not clinical judgment. Nothing here is personal medical advice, and no page can account for your particular situation.

Editorial status: Source checked This page was written with AI assistance and checked line by line against the sources listed on it. That confirms the sources support what the page says. It is not a medical review, and it does not confirm the page is complete or right for your situation.

Human medical review: not completed. Pages here are not signed off by a clinician before they publish. That is not an oversight we are quietly working around: we restate published guidance and cite it, so the authority belongs to the source rather than to us, and every page names where its claims come from — you can verify us instead of trusting us. Where a volunteer clinician has reviewed a page, their name and credentials appear on it; where no name appears, no clinician has checked it. We are glad to have reviewers and are recruiting them, and we do not hold pages back waiting for one. Use this site to understand your situation and to ask better questions of the people treating you.

Read more about our editorial process, our use of AI, and our corrections policy.

Spotted a problem? Report an error — a factual mistake, broken or outdated source, confusing wording, or anything that seems unsafe. Please do not include names, medical record numbers, dates of birth, addresses, or other identifying medical information in your report.

After using this page, do you understand what to do next?

Anonymous — we only record the answer, never who gave it.