How Do You Get H. Pylori and How to Prevent It

H. pylori spreads primarily from person to person, most often within families during childhood, through oral or fecal-oral contact. Contaminated water and food are secondary routes, but close contact with an infected household member is the single biggest risk factor. The bacterium infects roughly half the world’s population, and because most people pick it up before age ten and carry it silently for life, prevention hinges on understanding how and when exposure actually happens.

Person-to-Person Spread Is the Main Route

Researchers have studied H. pylori transmission for decades, and the evidence consistently points to direct person-to-person contact as the dominant pathway. The bacterium has been detected in saliva, vomit, and stool, which means any activity that brings someone into contact with these can pass it along. A large study of adults in the United Kingdom found that close contact during childhood, including the number of people sharing a bedroom and overall household crowding, was a strong predictor of who carried the infection later in life, suggesting that transmission happens directly between people, often early on.1PubMed Central. Relation between infection with Helicobacter pylori and living conditions in childhood: evidence for person to person transmission in early life

This fits a pattern seen worldwide. A review of transmission routes confirmed that person-to-person spread, especially within families, appears to be the prevailing mode, though environmental contamination remains possible.2PubMed Central. Helicobacter pylori, transmission routes and recurrence of infection: state of the art The practical implication is straightforward: living in close quarters with someone who carries H. pylori, particularly during your early years, is the likeliest way you would have acquired it.

Why Families Are the Epicenter

Within the broader person-to-person picture, the family unit stands out. A Japanese study used genetic fingerprinting of H. pylori strains collected from family members and found that the dominant transmission path was intrafamilial, with mother-to-child spread being especially common, followed by sibling-to-sibling transmission.3PubMed. Intrafamilial, Preferentially Mother-to-Child and Intraspousal, Helicobacter pylori Infection in Japan Determined by Mutilocus Sequence Typing and Random Amplified Polymorphic DNA Fingerprinting Mother-to-child transmission makes intuitive sense: young children spend the most time in close physical contact with their mothers, share utensils, and are often exposed to saliva through everyday caregiving behaviors like pre-chewing food or testing food temperature by mouth.

Spousal transmission also occurs but appears less frequent than parent-to-child or sibling transmission, possibly because adult immune systems are better equipped to resist new colonization. The takeaway for families is that when one parent tests positive, the children in the household face a meaningfully elevated chance of carrying the same strain.

Water, Food, and Other Environmental Sources

While close contact dominates, H. pylori can also reach you through the environment. The bacterium has been found surviving in untreated water sources, and one study linked well water consumption with higher rates of infection.4PubMed Central. Living Conditions and Helicobacter pylori in Adults In regions that rely on unpiped or unchlorinated water, this route can be significant.

Food is another potential vehicle. A review of the literature found H. pylori present in milk, vegetables, and meat samples, suggesting that contaminated food could play a role in environmental transmission, particularly in settings where food handling and refrigeration practices are inconsistent.5PubMed Central. Role of food in environmental transmission of Helicobacter pylori This does not mean grocery-store produce in a high-income country is a major risk. The concern is more relevant where food is prepared with contaminated water, or where raw and undercooked foods are common, and sanitation infrastructure is limited.

Can You Catch It at Work or in a Hospital?

Occupational exposure is a question that comes up frequently, especially for healthcare workers. A study comparing hospital staff across different departments found that workers with direct patient contact, including those in endoscopy units, had roughly double the infection rate of staff who worked in labs and offices without patient contact.6PubMed Central. Does hospital work constitute a risk factor for Helicobacter pylori infection? Nurses showed the highest rates among healthcare categories. Interestingly, the length of employment itself was not a significant predictor, suggesting that the risk comes from the nature of the contact rather than cumulative years on the job.

For the general public, this finding does not imply you are likely to catch H. pylori from a hospital visit. The elevated risk applies to staff members who handle bodily secretions regularly. It does reinforce the broader point that any situation involving repeated close contact with potentially infected individuals increases transmission risk.

Why Childhood Matters So Much

One of the most consistent findings across H. pylori research is that infection is overwhelmingly acquired in childhood. Adults can and do get infected, but the rates of new adult acquisition are much lower. Several factors converge in childhood to make transmission easier: developing immune systems, frequent hand-to-mouth behavior, close physical contact with caregivers and siblings, and, in many parts of the world, crowded living conditions.

A cross-sectional study in Japan found that infection rates dropped steadily as socioeconomic status rose and that having more siblings independently increased the likelihood of being positive for H. pylori.7PubMed Central. Impact of socioeconomic status and sibling number on the prevalence of Helicobacter pylori infection: a cross-sectional study in a Japanese population More siblings mean more potential carriers in the household, and lower socioeconomic status often correlates with more crowded housing, less reliable water treatment, and other conditions that favor transmission. These childhood exposures cast a long shadow: once you acquire H. pylori, it typically persists for life unless treated with antibiotics.

How H. Pylori Survives Inside You

The stomach is one of the most hostile environments in the body, with a pH low enough to dissolve metal. H. pylori’s ability to colonize it is one of the reasons it is so difficult to dislodge naturally. The bacterium produces an enzyme called urease that breaks down urea into ammonia, locally raising the pH around itself and creating a more hospitable microenvironment.8PubMed Central. Helicobacter pylori moves through mucus by reducing mucin viscoelasticity It also uses its corkscrew-shaped body and spinning flagella to burrow into the thick mucus layer that protects the stomach lining, essentially hiding from both stomach acid and immune cells.

Once embedded, H. pylori can deploy virulence factors that damage stomach tissue. One well-studied protein, CagA, is injected directly into the cells of the stomach lining, where it disrupts normal cell signaling and promotes inflammation.9PubMed Central. Helicobacter pylori Virulence Factor Cytotoxin-Associated Gene A (CagA)-Mediated Gastric Pathogenicity Not all strains carry CagA, which is one reason different people experience very different outcomes from the same infection. The host immune system mounts a chronic inflammatory response but cannot clear the bacterium, and it is this persistent inflammation, over years and decades, that drives the most serious complications.10PubMed Central. Helicobacter pylori and gastric cancer: factors that modulate disease risk

What Happens If You Are Infected

Most people with H. pylori never know they have it. Roughly seven out of ten infected individuals remain symptom-free throughout their lives. Among those who do develop problems, the range includes chronic gastritis (ongoing stomach inflammation), peptic ulcers in the stomach or duodenum, and in a smaller fraction, more serious conditions such as gastric cancer or a rare type of stomach lymphoma called MALT lymphoma.2PubMed Central. Helicobacter pylori, transmission routes and recurrence of infection: state of the art The outcome depends on a combination of the bacterial strain’s virulence, your own genetic makeup, and lifestyle factors including diet.

A review of how diet interacts with H. pylori found that the combination of the infection, host genetics, immune response, and an unhealthy or unbalanced diet can all influence whether the infection stays silent or progresses toward disease.11PubMed Central. Impact of Dietary Patterns on H. pylori Infection and the Modulation of Microbiota to Counteract Its Effect. A Narrative Review Diets high in salt, processed meats, and low in fruits and vegetables appear to tilt things in a worse direction, while diets rich in fresh produce and fiber may offer some protection against the worst outcomes. This does not mean you can eat your way out of an infection, but it does matter for long-term risk.

Practical Prevention Strategies

Because no vaccine is currently available, preventing H. pylori comes down to reducing your exposure to the routes described above. Researchers have been working on a vaccine for years, and early results from a novel multi-epitope vaccine showed promise in laboratory and animal models, but no vaccine has yet demonstrated lasting effectiveness in human clinical trials.12npj Vaccines. A novel multi-epitope vaccine induces protective and therapeutic immunity against Helicobacter pylori Until one arrives, prevention is about hygiene and environment.

The evidence points to several concrete steps:

  • Handwashing: Thorough handwashing, particularly before eating and after using the bathroom, is one of the clearest protective factors. A study of living conditions and H. pylori found that lower frequency of handwashing before using the bathroom was significantly associated with infection.4PubMed Central. Living Conditions and Helicobacter pylori in Adults
  • Safe water: The same study found well water consumption was linked to higher infection rates. If you live in an area without treated municipal water, boiling or filtering drinking water is a reasonable precaution.
  • Food safety: Washing fruits and vegetables thoroughly and cooking food properly reduces the chance of ingesting contaminated material, especially in regions where H. pylori has been detected in food supplies.
  • Avoiding shared utensils with known carriers: Because oral-oral transmission is a real pathway, families where one member has been diagnosed should avoid sharing cups, cutlery, and toothbrushes.
  • Testing family members: If you have been treated for H. pylori, having close household contacts tested and treated can reduce the chance of reinfection from someone living under the same roof.

None of these measures offer a guarantee, but together they address the major known transmission routes. For parents in particular, being aware that childhood is the peak window for acquisition can motivate better hygiene habits during the years when children are most vulnerable.

Getting Tested

If you suspect you have H. pylori, or if a family member has been diagnosed, testing is straightforward and can be done without an invasive procedure. The two main non-invasive options are the urea breath test and the stool antigen test. Both are useful for initial diagnosis and for confirming whether treatment has successfully cleared the infection.13PubMed Central. Non-invasive tests for the diagnosis of helicobacter pylori: state of the art

The breath test tends to be more accurate. One study comparing the two found the breath test had a sensitivity of about 94% and accuracy of roughly 87%, while the stool antigen test came in at about 77% sensitivity and 77% accuracy.14PubMed Central. The Use of 13C-Urea Breath Test for Non-Invasive Diagnosis of Helicobacter pylori Infection in Comparison to Endoscopy and Stool Antigen Test In children, the difference is similar: the breath test showed a sensitivity around 89% compared to roughly 73% for the stool test.15Adolescência e Saúde. Comparison Between Urea Breath Test and Stool Antigen Test for Diagnosis of Helicobacter Pylori in Children and Adolescent in Erbil City The stool test is cheaper and easier to administer, which makes it a practical first choice in many settings, especially for screening family members. If results are uncertain or you need to confirm eradication after treatment, the breath test is the stronger option.

Blood antibody tests also exist but are less useful for active diagnosis because antibodies can linger long after the bacterium is gone, leading to false positives in people who were previously infected and already treated.

Treatment Success and the Risk of Coming Back

Standard treatment involves a course of antibiotics combined with an acid-suppressing medication, typically taken for two weeks. Success rates vary depending on local antibiotic resistance patterns, which have been shifting in recent years as resistance to commonly used drugs like clarithromycin rises. Your doctor will usually recommend a follow-up test at least four weeks after finishing antibiotics to confirm eradication.

The good news is that once you clear the infection, reinfection in a high-income country is uncommon. A meta-analysis of follow-up studies found that the annual recurrence rate after successful eradication was about 2.7% in developed countries, dropping to roughly 1.5% per year with longer follow-up, likely because some early “recurrences” are actually the original infection that was not fully cleared.16PubMed. Helicobacter pylori recurrence in developed and developing countries: meta-analysis of 13C-urea breath test follow-up after eradication In developing countries, the annual recurrence rate was much higher, around 12-13%, reflecting the greater environmental burden and difficulty avoiding re-exposure.

A large prospective study in China identified several independent risk factors for reinfection: lower education levels, having a family history of gastric cancer, and living in certain higher-prevalence regions.17PubMed Central. Long-term follow-up of Helicobacter pylori reinfection and its risk factors after initial eradication: a large-scale multicentre, prospective open cohort, observational study A family history of gastric cancer carried a particularly strong association with reinfection, which may reflect both shared household exposure and underlying genetic susceptibility. This underscores the importance of treating the whole household rather than just the individual who was diagnosed.

Why Treating H. Pylori Matters for Cancer Prevention

H. pylori is classified as a Group 1 carcinogen by the World Health Organization, meaning there is sufficient evidence that it causes cancer in humans, specifically gastric cancer. But the relationship is not automatic. The vast majority of infected people will never develop stomach cancer; the risk is elevated but still relatively small for any individual. What makes eradication compelling at a population level is the sheer number of people infected worldwide.

A systematic review and meta-analysis of nine controlled clinical trials found that eradicating H. pylori reduced the risk of developing gastric cancer by roughly 21-30% in populations where the infection is common.18PubMed Central. Eradication of Helicobacter pylori in the Primary Prevention of Gastric Cancer: A Systematic Review and Meta-Analysis That reduction is clinically meaningful across large populations, even if the absolute risk for any one person is modest. In countries with high gastric cancer rates, like Japan and South Korea, mass screening and eradication programs have already been implemented as part of national cancer prevention strategies.

Your Genes Play a Role Too

Not everyone exposed to H. pylori becomes chronically infected, and not everyone who is infected develops disease. Part of the explanation lies in host genetics. A study of children found that certain variations in genes controlling the inflammatory response, specifically in the interleukin-6 and TNF-alpha genes, were associated with H. pylori infection. Children carrying two of these variant alleles had roughly double the risk of acquiring the infection compared to those with none.19PubMed Central. The impact of host’s genetic susceptibility to Helicobacter pylori infection in children

Genetics also influence what happens after infection. Variations in the interleukin-1B gene have been linked to worse outcomes in people with H. pylori-associated stomach inflammation.20PubMed Central. Association of Interleukin-1B gene Polymorphism with H. pylori infected Dyspeptic Gastric Diseases and Healthy Population And the interaction between genetics and H. pylori can be striking when it comes to cancer risk. One study found that people who were both H. pylori-positive and carried a specific interleukin-6 gene variant had more than three times the risk of gastric cancer compared to uninfected people without the variant.21PubMed. Impact of interaction between interleukin-6 gene polymorphism and Helicobacter pylori infection on susceptibility to gastric cancer You cannot change your genes, but knowing that a strong family history of stomach cancer combined with H. pylori positivity compounds the risk can inform decisions about testing and treatment.

An Ancient Relationship, and a Possible Flip Side

H. pylori is not a recent human problem. Evidence suggests that humans have been colonized by this bacterium for at least 50,000 years, likely throughout our entire evolutionary history.22PubMed Central. Coadaptation of Helicobacter pylori and humans: ancient history, modern implications That kind of timeline raises an uncomfortable question: could an organism we have lived with for so long actually be doing something useful?

There is some evidence it might. A study using data from a large national health survey found an inverse association between H. pylori infection and asthma and allergic conditions, meaning people who carried the bacterium were less likely to have these disorders. The authors suggested that the ongoing disappearance of H. pylori in developed countries could be contributing to the rise in asthma and atopic diseases.23JAMA Internal Medicine. Inverse Associations of Helicobacter pylori With Asthma and Allergy This does not mean anyone should seek out H. pylori infection on purpose. The cancer and ulcer risks are real and well-documented. But it does add nuance to the story: eradicating a lifelong companion organism may come with trade-offs that researchers are still working to understand.

Can Pets Transmit H. Pylori?

This is a question that does not get much airtime but matters for pet owners. A case report documented the transmission of H. pylori between a human owner and two pet dogs living in the same household. Genetic analysis of bacterial samples from all three showed identical strains, confirming that the same H. pylori was circulating between the human and the animals.24PubMed. Transmission of Helicobacter pylori between a human and two dogs: A case report This is a single case report, not proof that dog-to-human transmission is common, but it does establish that it can happen. For households dealing with recurrent H. pylori despite treatment, the family pet is worth considering as a potential reservoir, especially in cases where all human contacts have been tested and treated but the infection keeps returning.