An ulcer attack feels like a burning or gnawing pain high in the belly, and it often strikes when the stomach is empty. The fastest way to calm one is to eat a small, bland meal to buffer stomach acid, take an antacid if your doctor has approved one, and avoid alcohol, coffee, and cigarettes until the pain settles. Then call your doctor, because lasting relief from an ulcer comes from treating the cause, not just easing the symptoms.
Most peptic ulcers are caused by one of two things: a bacterium called Helicobacter pylori or long-term use of nonsteroidal anti-inflammatory drugs (NSAIDs) like ibuprofen and naproxen. That matters because the steps that calm an attack in the moment are not the same as the steps that heal the ulcer. This guide covers both.
What Is Actually Happening During an Ulcer Attack?
A peptic ulcer is an open sore in the lining of the stomach or the first part of the small intestine, called the duodenum. The lining that normally protects these organs from acid has been worn through, so acid and digestive enzymes reach tissue that is not built to handle them.
That is why the pain has a pattern. Stomach ulcers often hurt shortly after eating, when acid production rises. Duodenal ulcers more often hurt a few hours after a meal or in the middle of the night, when the stomach is empty and acid sits against the exposed tissue. Food or an antacid can briefly ease duodenal pain because it neutralizes or buffers acid.
One thing worth correcting: an ulcer is not caused by spicy food or stress, though both can make symptoms feel worse. The evidence consistently points to H. pylori infection and NSAID use as the main causes. A smaller number of ulcers are linked to other medications, serious illness, or, rarely, conditions that cause excess acid production.
How To Calm An Ulcer Attack Fast Relief Steps
These steps address the pain while you arrange proper care. They do not cure an ulcer.
- Eat something small and bland. A few crackers, plain toast, or a banana can buffer stomach acid. Keep the portion small so you do not overfill an irritated stomach.
- Take an antacid if it is appropriate for you. Over-the-counter antacids neutralize acid and can ease pain within minutes. If you take prescription medications, check with a pharmacist first, because antacids can interfere with how some drugs are absorbed.
- Sit upright and stay calm. Lying flat can let stomach contents move up into the esophagus and add heartburn to the picture. Slow breathing helps with the tension that makes pain feel sharper.
- Stop alcohol, coffee, and cigarettes for now. All three increase acid exposure and slow healing. Smoking in particular is linked to slower ulcer healing and higher rates of recurrence.
- Avoid NSAIDs. If you have been taking ibuprofen, naproxen, or aspirin for pain, stop unless a doctor has told you to continue. For aspirin taken for heart protection, do not stop without talking to your doctor first.
If the pain is severe, comes with vomiting blood or black tarry stools, or you feel faint, that is a medical emergency. Call 911 or go to an emergency department. Those signs can indicate a bleeding ulcer, which needs urgent treatment.
Do Antacids and Acid Reducers Really Help?
Antacids work fast and briefly. They neutralize acid already in the stomach, which is why relief can come within minutes, but the effect wears off and they do nothing to heal the ulcer itself.
Acid reducers work differently. Two main classes are used. H2 blockers, such as famotidine, reduce how much acid the stomach produces and are available over the counter. Proton pump inhibitors (PPIs), such as omeprazole, suppress acid more strongly and are the standard treatment for healing ulcers when prescribed by a doctor. PPIs generally take longer to reach full effect than antacids, so they are not a fast fix for an attack in progress.
Here is the distinction that matters: symptom relief and ulcer healing are two different goals. Antacids and H2 blockers can calm an attack. Healing an ulcer, and preventing it from coming back, usually requires treating the underlying cause with a doctor’s guidance.
Why You Should See a Doctor After an Attack
An ulcer that is calmed but not treated can keep returning, and in some cases it can bleed or perforate. Those are serious complications. Seeing a doctor turns a recurring problem into a solvable one.
Testing for H. pylori is a key step. It can be done with a breath test, a stool test, or a blood test, and a doctor will choose based on your situation. If H. pylori is present, treatment typically involves a combination of antibiotics plus an acid-reducing medication. Clearing the infection heals the ulcer in most people and greatly lowers the chance of it coming back.
If NSAIDs are the cause, the plan usually involves stopping them where possible and using acid-reducing medication while the lining heals. A doctor can also help find alternative pain relief. Some clinicians also recommend testing and treating H. pylori before long-term NSAID use in people at higher risk, though practice varies.
Testing matters because guessing is unreliable. Ulcer symptoms overlap with several other conditions, including acid reflux, gallstones, and irritable bowel syndrome. A doctor can sort out which one you are dealing with.
What Foods Help and What to Avoid During a Flare?
No food cures an ulcer, and no specific diet has been shown to heal one. The goal during a flare is to avoid things that increase acid or irritate the stomach lining, and to eat in a way that keeps acid from sitting against the sore.
Foods that tend to sit well include plain grains, bananas, cooked vegetables, lean protein, and low-fat dairy. Smaller, more frequent meals can help some people, since a large meal stretches the stomach and can increase discomfort. Eating a small snack before bed may ease nighttime duodenal pain, though it is worth discussing with your doctor.
Foods and drinks that commonly worsen symptoms include coffee (regular and decaf), alcohol, carbonated drinks, very spicy foods, and high-fat meals. These do not cause ulcers, but they can aggravate an existing one. Keeping a simple food diary can help you spot your own triggers.
Can Stress Cause an Ulcer?
Everyday stress does not cause peptic ulcers. This is one of the most persistent myths about ulcers, and it has been corrected by decades of research pointing to H. pylori and NSAIDs as the real causes.
Severe physical stress is a different story. Critically ill patients, such as those in intensive care after major trauma or burns, can develop stress ulcers, which is why hospitals use preventive acid-reducing medication in those settings. That is a distinct medical situation, not the kind of stress most people experience in daily life.
Stress can still affect how an ulcer feels. It can increase stomach acid, affect sleep, and lower your threshold for noticing pain. Managing stress is reasonable for overall comfort, but it is not a substitute for treating the underlying cause.
When Is Ulcer Pain a Medical Emergency?
Most ulcer pain is uncomfortable but not dangerous. Some signs mean you need emergency care right away.
- Vomiting blood, or vomit that looks like coffee grounds
- Black, tarry, or bloody stools
- Sudden, severe, sharp belly pain that does not ease
- Feeling faint, weak, or short of breath
- Pain that spreads to your back or shoulder
These can signal a bleeding ulcer or a perforated ulcer, where the ulcer has worn a hole through the stomach or intestinal wall. Both are emergencies that need immediate treatment. Do not wait to see if they pass.
The Bottom Line on Fast Relief
Calming an ulcer attack quickly comes down to buffering acid, avoiding irritants, and getting medical care. A small bland snack, an antacid if appropriate, and skipping alcohol, coffee, and NSAIDs can ease the pain in the short term. The lasting fix is finding and treating the cause, usually H. pylori infection or NSAID use, with a doctor’s help.
Do not treat recurring ulcer pain as something to manage alone with over-the-counter products. Relief that keeps coming back is a signal to get tested and treated properly.
Frequently Asked Questions
How long does an ulcer attack last?
It varies. Some attacks ease within minutes to an hour after eating or taking an antacid, while others last longer. Pain that persists for hours or keeps returning should be checked by a doctor.
What is the fastest way to stop ulcer pain?
A small bland snack or an antacid can ease pain quickly by buffering stomach acid. These calm the symptom but do not heal the ulcer, so see a doctor to treat the cause.
Can drinking milk calm an ulcer attack?
Milk may briefly soothe the stomach, but it also stimulates acid production, which can worsen pain later. It is not a reliable remedy for an ulcer attack.
Should I go to the ER for ulcer pain?
Go to the ER if you have vomiting blood, black or bloody stools, sudden severe belly pain, or feel faint. These can be signs of a bleeding or perforated ulcer and need emergency care.

