H. pylori (Helicobacter pylori) is a type of bacteria that lives in the lining of the stomach, where it can cause chronic inflammation, ulcers, and in some cases, stomach cancer. It infects roughly 44% of adults worldwide, making it one of the most common bacterial infections on Earth. Most people pick it up during childhood through contact with an infected person’s saliva, stool, or vomit, or through contaminated food and water.
How H. Pylori Survives in Your Stomach
Your stomach is one of the harshest environments in the body, with acid strong enough to break down food. Most bacteria can’t survive there. H. pylori can, thanks to a clever chemical trick: it produces an enzyme that breaks down urea (a natural compound in the stomach) into ammonium ions, which neutralize the acid in its immediate surroundings. This creates a small protective bubble of near-neutral pH around the bacterium.
That same chemical reaction also changes the texture of the mucus lining your stomach wall. Normally, stomach mucus forms a thick gel at low pH that traps bacteria. But when H. pylori raises the local pH, the gel loosens into a thinner, more liquid substance. The bacterium is spiral-shaped and has whip-like tails (flagella) that actually spin faster in acidic conditions, letting it swim through this loosened mucus and burrow into the deeper layers of the stomach lining. Once embedded there, it’s well protected from both stomach acid and your immune system.
How You Get H. Pylori
H. pylori spreads person to person, most commonly through saliva. Sharing utensils, cups, or close mouth-to-mouth contact with someone who carries the bacteria can transmit it. The fecal-oral route is another major pathway: if an infected person doesn’t wash their hands thoroughly after using the bathroom and then handles food or touches surfaces, the bacteria can spread to others.
Contaminated water is a significant source of infection in regions without reliable water treatment. This is a key reason why infection rates are much higher in developing countries, where roughly half or more of the population may carry the bacteria. In Africa and the Eastern Mediterranean, prevalence exceeds 52%.
Most infections happen during childhood, likely because children are more frequently exposed to the conditions that favor transmission: close physical contact with family members, shared food and drinks, and environments where hygiene practices may be inconsistent. Living in crowded households raises the risk, and infections tend to cluster within families. Once acquired, H. pylori can persist in the stomach for decades if untreated.
What H. Pylori Does to Your Stomach
Many people with H. pylori never develop symptoms. The bacteria can live quietly in the stomach lining for years without causing noticeable problems. But in about 10% of infected people, the ongoing infection leads to peptic ulcers, which are open sores in the stomach lining or the upper part of the small intestine.
Here’s what happens at the cellular level: once H. pylori attaches to the stomach wall, it injects proteins into the cells that disrupt normal cell signaling. This triggers chronic inflammation as your immune system tries, and fails, to clear the infection. Over time, that sustained inflammation damages the stomach lining, increases cell turnover, and weakens the protective barrier that keeps acid away from the tissue underneath. The result can be pain, bleeding, or ulceration.
When symptoms do appear, they typically include:
- A burning or gnawing pain in the upper abdomen, often worse on an empty stomach
- Bloating and frequent burping
- Nausea or loss of appetite
- Unintentional weight loss
The Link to Stomach Cancer
H. pylori is classified as a definite carcinogen. The majority of gastric adenocarcinoma cases, the most common form of stomach cancer, are attributed to H. pylori infection. The bacterium is also the primary cause of a type of stomach lymphoma called MALT lymphoma. The mechanism is essentially the same process that causes ulcers, taken further: decades of chronic inflammation lead to progressive changes in the stomach cells, eventually pushing some toward uncontrolled growth.
The overall risk for any individual remains low. Most people with H. pylori never develop cancer. But because the infection is so widespread globally, it accounts for a substantial share of stomach cancer cases at the population level.
How H. Pylori Is Diagnosed
Testing is straightforward and usually doesn’t require any invasive procedures. The two most common non-invasive options are a breath test and a stool test.
For the breath test, you swallow a small amount of a specially labeled urea compound. If H. pylori is present in your stomach, its enzyme breaks down the urea and releases labeled carbon dioxide, which you then breathe out and a machine detects. This test has the highest accuracy of the non-invasive options, correctly identifying about 94% of infections. The stool antigen test, which looks for H. pylori proteins in a stool sample, catches about 83% of infections. Blood tests that check for antibodies are also available but are less reliable because they can stay positive long after an infection has been cleared.
If you’re having an upper endoscopy for another reason (a camera passed down your throat to examine the stomach), the doctor can take a small tissue sample and test it directly.
How H. Pylori Is Treated
Treatment involves a combination of antibiotics and an acid-reducing medication, taken together for 10 to 14 days. The acid reducer lowers stomach acid levels, making the environment less hospitable for the bacteria and allowing the antibiotics to work more effectively.
The specific combination your doctor chooses depends partly on local patterns of antibiotic resistance. In areas where resistance to one of the most commonly used antibiotics (clarithromycin) is high, regimens that include bismuth (the active ingredient in Pepto-Bismol) along with two other antibiotics tend to perform significantly better. Longer courses of 14 days generally outperform shorter 7-day courses regardless of the regimen.
Treatment successfully clears the infection in most people, but rising antibiotic resistance has made some regimens less effective than they used to be. If the first round doesn’t work, your doctor will typically try a different combination of antibiotics for the second attempt. After treatment, a follow-up breath test or stool test confirms the bacteria are gone.
Side effects during treatment are common but usually manageable. Expect some nausea, a metallic taste in the mouth, diarrhea, or mild stomach discomfort. These typically resolve once the course is finished.
Reducing Your Risk
Because H. pylori spreads through direct contact with infected bodily fluids and through contaminated food and water, prevention comes down to basic hygiene. Wash your hands thoroughly before eating and after using the bathroom. When traveling in regions where water quality is uncertain, stick to bottled or treated water and avoid raw foods washed in local tap water. These same precautions protect against many other gastrointestinal infections as well.
There is no vaccine for H. pylori. Given that most infections happen in early childhood within family settings, the single most impactful factor is access to clean water and sanitary living conditions, which explains why infection rates have been steadily declining in industrialized countries over the past several decades.