HomeArrow IconOur BlogArrow IconCauses of Stomach Ulcer: H. pylori, Painkillers, and Risk Factors

Causes of Stomach Ulcer: H. pylori, Painkillers, and Risk Factors

June 5, 2026

Share

Facebook IconTwitter IconLinkedin IconInstagram IconEmail Icon

Last updated: 5/6/2026

The causes of stomach ulcer often begin with a problem in the protection of the stomach lining, not with spicy food or stress alone. An ulcer is an open sore in the lining of the stomach or the first part of the small intestine. It may cause burning pain in the upper abdomen, nausea, bloating, or feeling full quickly.

The most important causes of stomach ulcer are H. pylori infection and the repeated use of certain painkillers, especially nonsteroidal anti-inflammatory drugs such as ibuprofen, naproxen, and aspirin. Therefore, temporarily relieving the pain is not enough. The real cause must be identified before choosing treatment.

At Magrabi Hospitals, we recommend seeing a doctor if stomach pain keeps recurring, or if it appears with vomiting, weight loss, black stools, vomiting blood, or dizziness. These signs may indicate bleeding or complications that require urgent evaluation.

What are the most common causes of stomach ulcer?

When searching for stomach ulcer causes or what causes stomach ulcers, you will find that the most medically important cause is damage to the protective barrier of the stomach lining. When the protective mucus layer becomes weak, acid can irritate the lining and form an ulcer.

The NIDDK page on symptoms and causes of peptic ulcers explains that the most common causes are H. pylori infection and nonsteroidal anti-inflammatory drugs.

The NHS page on stomach ulcers also states that H. pylori infection and regular use of anti-inflammatory painkillers are among the main causes.

Common causes of stomach ulcer include:

  • H. pylori infection.
  • Regular use of anti-inflammatory painkillers.
  • Aspirin, especially when used for long periods or with other medications.
  • Smoking.
  • Alcohol consumption.
  • Previous history of ulcers.
  • Older age.
  • Using more than one painkiller at the same time.
  • Some medications, such as blood thinners or corticosteroids, when combined with painkillers.

How does H. pylori cause an ulcer?

H. pylori, or Helicobacter pylori, can live in the mucus layer that protects the stomach. In some patients, it causes chronic inflammation. This inflammation weakens the natural defense of the stomach lining.

Not everyone with H. pylori will develop an ulcer. However, the presence of H. pylori with recurrent upper abdominal pain, burning, nausea, or a family history of stomach problems makes testing important.

The doctor may request:

  • A breath test.
  • A stool test.
  • Gastroscopy, depending on the case.

We do not recommend taking antibiotics on your own, because H. pylori treatment requires a specific combination and a precise duration.

The Egyptian Drug Authority, through its antibiotic awareness initiative, highlights the importance of rational antimicrobial use and the risks of overuse.

Do painkillers cause stomach ulcers?

Yes, painkillers may be among the most important causes of stomach ulcer, especially when used regularly without medical supervision. This does not mean every painkiller, but mainly nonsteroidal anti-inflammatory drugs such as ibuprofen, naproxen, and diclofenac, in addition to aspirin.

These medications may reduce the substances that help the stomach protect its lining. As a result, acid becomes more capable of causing irritation or ulceration.

The risk increases in the following cases:

  • Older age.
  • Using high doses.
  • Combining more than one painkiller.
  • Having H. pylori infection.
  • Using aspirin with other painkillers.
  • Using blood thinners or corticosteroids with painkillers.

Patients can refer to the Saudi Drug Information System of the Saudi Food and Drug Authority to check medication information. However, the decision to continue or stop a medication must be made with a doctor, especially if the medication is prescribed for the heart or joints.

What is the relationship between aspirin and stomach ulcers?

The relationship between aspirin and stomach ulcers is very important, because some patients take aspirin daily to prevent blood clots. Aspirin may increase irritation of the stomach lining and may raise the risk of bleeding, especially when used with other painkillers or blood thinners.

Do not stop aspirin on your own if your doctor prescribed it for the heart or blood vessels. Stopping it suddenly may be dangerous in some cases. It is better to consult your doctor to assess alternatives or prescribe a medication to protect the stomach when needed.

What is the cause of stomach ulcer in people who do not use painkillers?

If you are asking what the cause of stomach ulcer is even though you do not use painkillers, H. pylori is an important possibility.

There may also be less common causes, such as:

  • Some chronic diseases.
  • Rare tumors that increase acid secretion.
  • Other medications that raise ulcer risk when used with painkillers.

This is where examination becomes more important than guessing. The doctor does not only look for the pain, but also for the cause. Therefore, when discussing the causes and treatment of stomach ulcers, treatment should begin with the correct diagnosis.

Does stress cause stomach ulcers?

The question “does stress cause stomach ulcers?” is very common. Stress alone is not considered a main direct cause of most ulcers. However, it may increase the feeling of pain, affect appetite and sleep, and may push some people toward smoking, excessive coffee intake, or using painkillers.

Therefore, we do not ignore stress as one of the factors that may worsen symptoms, but it is not a substitute for testing for H. pylori or reviewing medications. If stomach pain is persistent, do not explain it as stress only.

Does coffee cause stomach ulcers?

The question “does coffee cause stomach ulcers?” needs an accurate answer. Coffee is not considered one of the main causes of stomach ulcers like H. pylori or painkillers, but it may irritate symptoms in some patients.

If you notice that coffee increases burning or pain, reduce it temporarily and monitor your symptoms. However, do not rely on stopping coffee alone if the pain is recurring, because the causes of stomach ulcer may be deeper and may require medical treatment.

Does garlic cause stomach ulcers?

The question “does garlic cause stomach ulcers?” is frequently asked. Garlic is not considered a proven direct cause of ulcers in most people, but it may cause burning or irritation in some patients with sensitive stomachs.

If garlic increases your pain, avoid it during symptom flare-ups. However, recurrent burning pain, nausea, or dark stools should not be explained by garlic alone.

Who is more likely to develop a stomach ulcer?

The likelihood of developing an ulcer increases when clear risk factors are present.

The most important risk factors include:

  • H. pylori infection.
  • Long-term use of anti-inflammatory painkillers.
  • Daily aspirin use.
  • Older age.
  • Smoking.
  • Alcohol consumption.
  • Previous history of ulcers.
  • Use of blood thinners or corticosteroids with painkillers.
  • Chronic diseases that require multiple medications.

In Saudi Arabia, general health guidance can be followed through the Saudi Ministry of Health, especially when symptoms are recurrent or when reliable information about prevention and medical consultation is needed.

What causes of stomach ulcer require urgent medical attention?

Not every stomach pain is dangerous, but some signs should not be ignored. See a doctor immediately if you experience:

  • Vomiting blood or vomit that looks like coffee grounds.
  • Black stools or blood in the stool.
  • Severe and sudden abdominal pain.
  • Dizziness or fainting.
  • Unexplained weight loss.
  • Difficulty swallowing.
  • Persistent vomiting.
  • Pain that returns after acidity medications.
  • Severe fatigue with paleness.

These signs may indicate bleeding, perforation, or obstruction. Early diagnosis protects the patient from complications.

How are the causes of stomach ulcer diagnosed?

Diagnosis depends on symptoms, age, medications used, and the presence of warning signs.

The doctor may request:

  • H. pylori breath test.
  • Stool test.
  • Blood test in specific cases.
  • Gastroscopy if symptoms are severe or recurrent.
  • Review of the medication list, especially painkillers and aspirin.

Understanding the causes of stomach ulcer helps choose the right treatment. Treating H. pylori is different from treating an ulcer caused by painkillers.

What is the difference between treating the cause and relieving symptoms?

Relieving symptoms means reducing acid or calming the burning sensation. Treating the cause means eliminating H. pylori, adjusting painkillers, or protecting the stomach if the patient needs a medication that cannot be stopped.

Therefore, when asking about the causes and treatment of stomach ulcers, there is no single answer or one medication for all cases.

Treatment may include:

  • Proton pump inhibitors.
  • Antibiotics when H. pylori is present.
  • Stopping or changing painkillers.
  • Modifying irritating habits.

The NIDDK page on treatment of peptic ulcers explains that ulcer treatment aims to heal the ulcer and treat the cause, whether it is H. pylori or the use of nonsteroidal anti-inflammatory drugs.

How can you reduce the risk of stomach ulcers?

The risk can be reduced through practical steps:

  • Do not use anti-inflammatory painkillers for long periods without a doctor.
  • Do not combine more than one painkiller at the same time.
  • Tell your doctor if you have a previous history of ulcers.
  • Do not stop prescribed aspirin without medical advice.
  • Test for H. pylori when symptoms are recurrent.
  • Stop smoking.
  • Reduce alcohol if present.
  • Avoid foods or drinks that irritate your symptoms.
  • Follow the antibiotic doses exactly if they are prescribed.

Patients in Qatar can also refer to the Your Health page from Hamad Medical Corporation for general health education materials that help them understand symptoms and know when medical care is needed.

 

Conclusion

The causes of stomach ulcer are not limited to food or stress. The most common cause is often H. pylori infection or repeated use of painkillers, with factors that increase the risk such as aspirin, smoking, age, or previous history of ulcers. Correct diagnosis determines the correct treatment. At Magrabi Hospitals, we recommend seeing a doctor when pain recurs or when signs of bleeding or weight loss appear.

References:

 

Medical Review:

Reviewed by Magrabi’s editorial team with the support of specialized doctors.

Disclaimer:

This article is for health education purposes only and is not a substitute for consultation with a specialist doctor.

 

Magrabi Health Editorial Team

Magrabi Health Editorial Team

The Magrabi Health Editorial Team creates educational medical content designed to help readers better understand symptoms, diagnostic tests, treatment options, and preventive healthcare measures across a wide range of medical topics, drawing on trusted sources and specialized clinical expertise. Since 1955, Magrabi Health has built more than 70 years of experience in specialized healthcare through a regional network of over 40 facilities across 5 countries. Its commitment to quality and patient safety is reflected in numerous accreditations and recognitions, including the designation of several eye centers as Centers of Excellence in Ophthalmology by the Surgical Review Corporation (SRC). This content is intended for educational purposes only and should not be considered a substitute for professional medical advice, diagnosis, or treatment.

FAQ

What are the causes of stomach ulcer?

The most important causes of stomach ulcer are H. pylori infection and regular use of nonsteroidal anti-inflammatory drugs such as ibuprofen, naproxen, and aspirin. Other factors may increase the risk, such as smoking, older age, previous history of ulcers, or using blood-thinning medications with painkillers.

Does H. pylori cause ulcers?

Yes. H. pylori may cause chronic inflammation in the stomach lining, which can lead to an ulcer in some patients. It does not cause ulcers in everyone infected, but recurrent symptoms require testing and proper treatment under medical supervision.

Do painkillers cause stomach ulcers?

Yes, some painkillers may cause stomach ulcers, especially nonsteroidal anti-inflammatory drugs when used for a long time or in high doses. The risk increases with aspirin, blood thinners, corticosteroids, older age, or the presence of H. pylori.

Does stress cause stomach ulcers?

Stress is not considered a common direct cause of ulcers like H. pylori or painkillers. However, it may increase the feeling of symptoms, affect eating and sleeping patterns, and may lead to painkiller use or smoking, which can worsen the problem.

Does coffee cause stomach ulcers?

Coffee is not considered a main direct cause of stomach ulcers, but it may increase burning or pain in some patients. If coffee irritates your symptoms, it is better to reduce it, while not ignoring the real causes of recurrent pain.

Does garlic cause stomach ulcers?

Garlic is not considered a proven direct cause of stomach ulcers, but it may cause irritation or burning in some people. If symptoms increase after eating it, it can be avoided temporarily, but recurrent pain requires medical evaluation.