What this article covers
- What is a stomach ulcer and what does it feel like?
- Is it an ulcer, acid reflux or gastritis?
- Warning signs: when a stomach ulcer is an emergency
- What causes stomach ulcers? H. pylori and painkillers
- Painkillers bought without a prescription: the hidden cause
- Spicy food, stress and fasting: what does and does not cause ulcers
- How is a stomach ulcer diagnosed?
- How is a stomach ulcer treated?
- Why the full course and a test of cure matter
What is a stomach ulcer and what does it feel like?
A stomach ulcer is an open sore in the lining of the stomach. When the same kind of sore forms in the duodenum, the first part of the small bowel just after the stomach, it is called a duodenal ulcer. Doctors group both under the name peptic ulcer. They form when the protective layer of mucus that normally shields the lining is damaged, so stomach acid can eat into the tissue beneath.
The typical symptom is a burning, gnawing or aching pain in the upper middle of the abdomen, between the bottom of the breastbone and the belly button. It often comes and goes over days or weeks. Many people also notice bloating, early fullness after a small meal, nausea or belching. A duodenal ulcer classically hurts two to three hours after eating or wakes you at night, and eases for a while with food or antacids. A stomach ulcer may hurt more soon after eating.
These patterns are a guide, not a rule. Many people with ulcers have vague indigestion, and some have no pain at all until the ulcer bleeds. This is especially true when the ulcer was caused by painkillers, because the same tablets that damaged the stomach also dull the pain. A large review published in The Lancet in 2024 estimates that between 0.12 and 1.5 percent of people have an active peptic ulcer in any given year.
Is it an ulcer, acid reflux or gastritis?
Upper abdominal discomfort has many causes, and they overlap. Acid reflux, also called heartburn or GERD, is acid rising up into the food pipe. It burns behind the breastbone, often climbs towards the throat, and is worse after a heavy meal, when lying down or when bending over. An ulcer pain sits lower, in the pit of the stomach, and does not usually rise into the chest or leave a sour taste in the mouth.
Gastritis means inflammation of the stomach lining without an open sore. It can cause very similar burning and nausea, and the same two causes, H. pylori and painkillers, are behind most cases. Gallstones cause a severe, steady pain under the right ribs that can spread to the back and often follows a fatty meal. Functional dyspepsia is the name for ongoing indigestion where tests find no ulcer or other cause, and it is actually more common than ulcers.
You cannot reliably tell these apart by symptoms alone, and that matters because the treatment differs. If your symptoms keep returning, if you are relying on antacids every day, or if you are older or have any of the warning signs in the next section, a doctor should assess you rather than leaving you to guess.
How the common causes of upper abdominal pain usually differ
| Condition | Where it hurts | Typical pattern | What usually helps |
|---|---|---|---|
| Duodenal ulcer | Pit of the stomach | Hours after meals, or at night | Eating or antacids, briefly |
| Stomach ulcer | Pit of the stomach | Soon after eating | Acid-reducing medicine |
| Acid reflux | Behind the breastbone, rising to the throat | After big meals, lying down, bending | Sitting upright, smaller meals |
| Gastritis | Upper abdomen, diffuse | Burning, nausea, fullness | Treating the cause |
| Gallstones | Under the right ribs, into the back | Severe attacks after fatty food | Needs medical review |
Warning signs: when a stomach ulcer is an emergency
Most ulcers are treated at home with tablets. Two complications, bleeding and perforation, are emergencies. An ulcer that erodes into a blood vessel can bleed heavily. You may vomit fresh red blood, or dark brown material that looks like coffee grounds, which is blood that has been partly digested by acid. Blood that passes through the bowel turns the stool black, sticky and tar-like with a very strong smell. Dizziness, fainting, a fast heartbeat or pale, clammy skin mean you have already lost a lot of blood.
Perforation means the ulcer has worn a hole right through the wall of the stomach or duodenum, so its contents leak into the abdomen. The pain is sudden, severe and constant, often described as the worst pain of your life, and the abdomen becomes hard and tender to touch. A 2015 review in The Lancet reports that perforated ulcers carry a death rate of up to 30 percent, and that early surgery and prompt treatment of infection are what save lives.
In either case, do not wait to see whether it settles, do not drive yourself, and do not take more painkillers. Go to the nearest hospital emergency department or call an ambulance. Black stools from iron tablets or bismuth medicines can look similar, but they are not sticky and tarry, and if you are unsure it is always safer to be checked.
What causes stomach ulcers? H. pylori and painkillers
Two causes account for the great majority of ulcers. The first is Helicobacter pylori, usually called H. pylori, a bacterium that lives in the lining of the stomach. It weakens the protective mucus, triggers inflammation and in some people increases acid production, which together allow an ulcer to form. Most infected people never get an ulcer, but the infection is so common that it remains the leading cause worldwide.
H. pylori is especially widespread in the Middle East and North Africa. A 2017 analysis of studies from 62 countries estimated that about 4.4 billion people carried the germ in 2015, with the highest rates in Africa. A 2014 review of studies across the Eastern Mediterranean region found rates in healthy adults ranging from 22 to 87.6 percent, and the first Middle East consensus on H. pylori, published in 2025, reports infection in 85 to 90 percent of adults in some regional studies. It usually spreads in childhood through contaminated food, water and close family contact.
The second cause is anti-inflammatory painkillers, known as NSAIDs, which include ibuprofen, diclofenac, naproxen, mefenamic acid and aspirin, even at the low dose used to protect the heart. They block substances that the stomach needs to make its protective mucus. We cover how H. pylori is tested in our guide to H. pylori testing, and who should avoid these painkillers in our guide to ibuprofen and NSAID risks, so here we focus on how they lead to ulcers and what to do about it.
The scale of the two main causes
Source: Hooi et al, Gastroenterology 2017; Sharara et al, World J Gastroenterol 2025; Al-Qahtani et al, 2022
Painkillers bought without a prescription: the hidden cause
Across the region, anti-inflammatory painkillers are easy to buy. A pharmacist will sell a strip of ibuprofen or diclofenac for back pain, a diclofenac injection is given for a sore knee, and cold and flu sachets often contain an NSAID without the buyer realising. A 2022 survey of medical students in Najran, Saudi Arabia, found that 60 percent had treated themselves with medicines in the previous six months, and that painkillers and NSAIDs were the most common choice, used by more than half of them. If future doctors do this, the general public does it more.
The risk of an ulcer rises with higher doses, longer use, and taking two NSAIDs together, for example a diclofenac tablet plus an ibuprofen cold remedy. It is much higher in people over 65, in anyone who has had an ulcer before, and when NSAIDs are combined with steroid tablets, blood thinners such as warfarin, or some antidepressants. Taking the tablets with food reduces stomach upset but does not prevent ulcers, because the damage happens through the bloodstream as well as directly.
If you take a daily low-dose aspirin or another blood thinner prescribed after a heart attack or stroke, do not stop it on your own because of stomach symptoms. Stopping can be dangerous. Speak to your doctor, who may add a stomach-protecting medicine. For everyday pain, paracetamol is usually gentler on the stomach, but ask a pharmacist what suits you and how much is safe.
Spicy food, stress and fasting: what does and does not cause ulcers
For most of the twentieth century, ulcers were blamed on stress and spicy food, and patients were put on bland milk diets. We now know that neither causes ulcers. Chilli, falafel, pickles or strong coffee may make an existing ulcer or gastritis hurt more, so it is sensible to avoid whatever triggers your pain, but cutting them out will not heal the ulcer. Milk soothes for a few minutes and then stimulates more acid, so it is not a treatment.
Severe physical stress is different. People who are critically ill in intensive care, after major burns, surgery or serious injury, can develop stress ulcers, which is why hospitals often give them stomach protection. Everyday emotional stress may make symptoms feel worse but is not a recognised cause on its own.
Smoking increases the risk of ulcers and slows their healing, and heavy alcohol use irritates the stomach lining. During Ramadan, long fasting hours followed by large meals can make ulcer and reflux symptoms worse. If you have an ulcer or take ulcer medicine, ask your doctor before Ramadan how to time your tablets around suhoor and iftar. A small number of ulcers have rare causes, such as a hormone-producing tumour, which a specialist looks for when ulcers keep coming back without H. pylori or painkillers.
How is a stomach ulcer diagnosed?
The only way to see an ulcer is an upper endoscopy, sometimes called a gastroscopy. A thin flexible camera is passed through the mouth into the stomach and duodenum, usually under a throat spray or light sedation, and it takes about ten to fifteen minutes. The doctor can see the ulcer, stop bleeding if there is any, and take small tissue samples to test for H. pylori and to rule out cancer.
Not everyone with indigestion needs an endoscopy. Younger people without warning signs are often tested for H. pylori with a breath or stool test and treated if it is positive. Endoscopy is recommended for people over about 55 with new symptoms, and at any age if there is weight loss, difficulty swallowing, repeated vomiting, anaemia, a family history of stomach cancer, or signs of bleeding. Age thresholds differ between countries, so follow your doctor's advice.
A stomach ulcer, as opposed to a duodenal one, is often checked with a second endoscopy after treatment, usually six to twelve weeks later. This is because a small number of stomach cancers look like ordinary ulcers at first, and seeing the ulcer heal completely is reassurance. If your doctor books a follow-up endoscopy, it is important to attend.
How is a stomach ulcer treated?
Ulcer treatment has two goals: heal the sore, and remove the cause so it does not come back. Healing is done with acid-reducing medicine, most often a proton pump inhibitor, or PPI, such as omeprazole, esomeprazole, lansoprazole or pantoprazole. These cut acid production sharply and are usually prescribed for four to eight weeks. Pain often improves within days, but the ulcer takes weeks to heal, so finishing the course matters.
If H. pylori is found, you will be given eradication therapy, a combination of a PPI with two or three antibiotics, sometimes with bismuth, taken together for usually ten to fourteen days. The exact combination depends on local antibiotic resistance. The 2025 Middle East consensus warns that resistance to clarithromycin, an antibiotic used in standard triple therapy, is rising across the region and is a leading reason for treatment failure, so doctors increasingly choose regimens that avoid it. Side effects such as a metallic taste, loose stools or nausea are common and usually manageable. Ask your doctor before stopping early.
If painkillers caused the ulcer, the doctor will advise stopping or changing them where possible. When an NSAID is truly needed, it may be continued with a PPI to protect the stomach. A study of 138 Middle Eastern outpatients on long-term NSAIDs with ulcers or erosions found that 90.6 percent had healed after five weeks of PPI treatment, that H. pylori was cleared in 85.5 percent of those treated for it, and that about 86 percent stayed healed after twenty weeks on a lower maintenance dose.
Outcomes in Middle Eastern NSAID users treated for ulcers
Source: Dajani et al, Saudi Journal of Gastroenterology, 2006
Why the full course and a test of cure matter
Feeling better is not proof that H. pylori has gone. The antibiotics fail in a meaningful share of people, especially where resistance is high, and an ulcer is likely to return if the germ survives. In the Middle Eastern study above, every patient whose H. pylori infection persisted had a relapse. Missing doses or stopping when the pain goes is one of the main reasons treatment fails, and it also helps resistant bacteria to spread.
That is why guidelines recommend a test of cure, a breath test or stool antigen test done at least four weeks after the antibiotics finish. PPIs can hide the germ and give a falsely negative result, so they are usually stopped about two weeks before the test if your doctor agrees. A blood antibody test is not suitable for this, because antibodies remain for months or years after the germ has gone. Our guide to H. pylori testing explains each test in detail.
If the test of cure is positive, a different antibiotic combination is used, not a repeat of the first one. Once you are clear, reinfection in adults is uncommon. To keep an ulcer from returning, avoid unnecessary NSAIDs, stop smoking, and tell any doctor or pharmacist that you have had an ulcer before they recommend a painkiller.
A typical treatment journey for an H. pylori ulcer
- Day 0 Ulcer found on endoscopy and H. pylori confirmed
- Days 1 to 14 Eradication course of acid medicine plus antibiotics, every dose taken
- Weeks 2 to 8 Acid-reducing medicine continues while the ulcer heals
- About 2 weeks before testing PPI paused if your doctor agrees
- At least 4 weeks after antibiotics Breath or stool test to confirm the germ has gone
- 6 to 12 weeks Repeat endoscopy for stomach ulcers, if your doctor advises
In the Sihtak app you can record your ulcer medicines and set reminders so that you finish every dose of the eradication course, and note the date your test of cure is due. Add your regular medicines to your profile so the health assistant can flag painkillers that may harm your stomach. It supports your doctor's care and does not replace it.
Frequently asked questions
How long does a stomach ulcer take to heal?
With acid-reducing medicine, most ulcers heal within four to eight weeks, although pain often improves within the first few days. Healing is only lasting if the cause, H. pylori or painkillers, is dealt with. Stomach ulcers are often checked with a repeat endoscopy to confirm complete healing.
Can a stomach ulcer heal on its own?
Some small ulcers heal temporarily without treatment, but they tend to come back if H. pylori is still present or painkillers are continued. An untreated ulcer can also bleed or perforate. It is safer to have it assessed and treated properly.
Does spicy food cause stomach ulcers?
No, spicy food does not cause ulcers. It may make existing ulcer or gastritis pain worse, so it is reasonable to avoid foods that trigger your symptoms while you heal. The real causes are H. pylori and anti-inflammatory painkillers.
What does an ulcer bleed look like?
You may vomit fresh blood or dark material like coffee grounds, or pass black, sticky, tar-like stools. You may also feel dizzy, weak or faint. Any of these signs needs a hospital emergency department straight away.
Can I take ibuprofen if I have had a stomach ulcer?
People who have had an ulcer are at much higher risk of another one with NSAIDs such as ibuprofen and diclofenac. Ask your doctor or pharmacist before taking any painkiller, as paracetamol is often a gentler choice. If an NSAID is truly needed, your doctor may add a stomach-protecting medicine.
Why do I need a test after finishing H. pylori treatment?
Treatment does not work for everyone, particularly where antibiotic resistance is common, and the ulcer can return if the germ survives. A breath or stool test at least four weeks after the antibiotics shows whether it has gone. A blood antibody test cannot confirm cure.
Is a stomach ulcer cancer?
Most stomach ulcers are not cancer. A small number of stomach cancers can look like an ulcer at first, which is why doctors take samples during endoscopy and often recheck stomach ulcers after treatment. Duodenal ulcers are very rarely cancerous.
Sources
- Almadi MA, Lu Y, Alali AA et al: Peptic ulcer disease, Lancet (London, England), 2024
- Sharara AI, Alsohaibani FI, Alsaegh A et al: First regional consensus on the management of Helicobacter pylori infection in the Middle East, World journal of gastroenterology, 2025
- Hooi JKY, Lai WY, Ng WK et al: Global Prevalence of Helicobacter pylori Infection: Systematic Review and Meta-Analysis, Gastroenterology, 2017
- Eshraghian A: Epidemiology of Helicobacter pylori infection among the healthy population in Iran and countries of the Eastern Mediterranean Region: a systematic review of prevalence and risk factors, World journal of gastroenterology, 2014
- Dajani A, Dham R, El-Sahhar M et al: Importance of Helicobacter pylori eradcation for maintenance of remission of drug associated peptic ulcer disease, Saudi journal of gastroenterology : official journal of the Saudi Gastroenterology Association, 2006
- Al-Qahtani AM, Shaikh IA, Shaikh MAK et al: Prevalence, Perception, and Practice, and Attitudes Towards Self-Medication Among Undergraduate Medical Students of Najran University, Saudi Arabia: A Cross-Sectional Study, Risk management and healthcare policy, 2022
- Søreide K, Thorsen K, Harrison EM et al: Perforated peptic ulcer, Lancet (London, England), 2015
This content is for health education only and is not a substitute for medical advice. If you have symptoms that worry you, see your doctor.