Does Fasting Cause Ulcers? Or Make Them Worse?

Understand the real impact of fasting on gastric health. Discover if it causes ulcers or merely affects existing conditions, with practical guidance.

Fasting does not cause stomach ulcers. The vast majority of peptic ulcers are driven by a bacterial infection or by certain medications, and going without food for hours or even a full day does not, on its own, create one. A review examining fasting and ulcer incidence found no significant increase in peptic ulcer development during fasting periods. That said, the relationship between fasting and stomach health is more layered than a simple “no.” Some complications from existing ulcers do appear to rise during prolonged fasts, and what you drink, what medications you take, and how your body handles acid all shape whether skipping meals is truly harmless for your gut.

What Happens in Your Stomach When You Stop Eating

Your stomach produces acid whether you eat or not. In healthy people at rest, the pH of the stomach sits around 2 to 3, which is strongly acidic. Food actually raises that pH temporarily because the meal itself dilutes and buffers the acid. So during a fast, your stomach is not producing some unusual surge of corrosive fluid; it is simply sitting at its normal resting acidity without the buffering effect of a meal.

What does change during fasting is the pattern of stomach activity. The digestive tract goes through repeating cycles of muscular contractions when it is empty, sometimes called “housekeeping waves.” During these cycles, acid secretion ramps up and bile from the small intestine can reflux back into the stomach. Right after the strongest wave passes, the stomach quickly alkalinizes again. This back-and-forth is normal physiology, not a sign of damage. Your body has been doing it every night while you sleep your entire life.

The stomach also has a built-in defense system: a thick layer of mucus studded with bicarbonate that sits directly on the stomach lining. This gel creates a pH gradient, so even though the open cavity of the stomach is highly acidic, the surface of the actual tissue stays close to neutral. Under normal conditions, this barrier is more than sufficient to protect the stomach wall from its own acid and digestive enzymes. The barrier holds up during fasting just as it does between meals on a normal eating schedule.

What Actually Causes Ulcers

Two culprits account for the overwhelming majority of peptic ulcers: infection with the bacterium Helicobacter pylori and regular use of nonsteroidal anti-inflammatory drugs (NSAIDs) such as ibuprofen, aspirin, and naproxen. H. pylori burrows into the mucus layer, weakens it from within, and triggers chronic inflammation. NSAIDs block the production of prostaglandins, chemical signals the stomach depends on to maintain its mucus lining and blood flow. Without those prostaglandins, the defensive barrier thins, and acid can reach the tissue underneath.

This distinction matters because the gnawing, burning feeling people get in their stomachs while fasting often gets blamed on an ulcer forming in real time. In reality, that sensation is usually just the normal acid environment making itself felt in the absence of food. The acid is not eating a hole through healthy tissue; it is irritating nerve endings that would otherwise be cushioned by a meal. True ulcer formation takes weeks of sustained damage to the mucus layer, not a few hours without breakfast.

What Ramadan Fasting Studies Reveal

Ramadan fasting offers researchers something close to a natural experiment: millions of people simultaneously stop eating and drinking during daylight hours for roughly a month, often for 14 to 18 hours per day depending on latitude and season. The evidence from studies tracking ulcer-related outcomes during Ramadan is genuinely mixed, and worth looking at in some detail because it is the best data we have on how extended daily fasts affect real stomachs.

On one side, a review of the literature concluded that fasting does not increase the overall incidence of peptic ulcers and that individuals with uncomplicated ulcers can safely participate in Ramadan fasting as long as they follow standard medical advice. That review did note some remodeling of the gastric environment and increased concentrations of H. pylori during fasting, but these changes did not translate into significantly more new ulcers.

On the other side, several hospital-based studies have found that ulcer complications spike during Ramadan. One study looking at upper gastrointestinal bleeding found that duodenal ulcer was a more frequent cause of bleeding during Ramadan than during a comparable non-fasting period, with about 1.7 times the adjusted odds. A separate endoscopy-based study also found significantly higher rates of duodenal ulcers and inflammation in patients examined during Ramadan compared with other times of the year. And a Turkish surgical database showed that peptic ulcer perforations, the most dangerous complication, occurred at roughly three times the monthly rate during Ramadan months compared with non-Ramadan months, with a particularly strong effect in men.

How do you reconcile these findings? The most coherent reading is that fasting does not create ulcers where none existed, but it can aggravate pre-existing ones. Someone carrying an undiagnosed ulcer or an active H. pylori infection may face a higher risk of that ulcer bleeding or perforating during a prolonged fast. Changes in meal timing, medication schedules, sleep patterns, and fluid intake during Ramadan likely all contribute. The fasting itself is one variable among many, not the sole driver.

Medications, Fasting, and Stomach Damage

If you take NSAIDs regularly and also fast, the interaction deserves attention. Animal studies have shown that fasting increases the gastric side effects of NSAIDs, while eating food alongside them shifts the damage further down the digestive tract to the small intestine. This has not been formally tested in humans, but it aligns with longstanding medical advice to take ibuprofen or aspirin with food. If you are doing intermittent fasting and popping an NSAID on an empty stomach every morning, you are removing two protective factors at once: the food buffer and the prostaglandin support your stomach lining relies on.

For people already on acid-suppressing medication after a bleeding ulcer, the type of drug matters during fasting periods. Proton pump inhibitors (PPIs) like omeprazole kept stomach pH substantially higher during a 24-hour fast than H2-receptor blockers like ranitidine, maintaining a near-neutral pH above 3 for over 90% of the fasting period compared with roughly 60% for the H2 blocker. If you have a known ulcer history and plan to fast, your choice of acid suppressor and its timing relative to your eating window is a practical conversation to have with a doctor.

Why Fasting Feels Like an Ulcer Even When It Is Not

A large part of the confusion around fasting and ulcers comes from how similar the symptoms feel. Burning in the upper abdomen, a gnawing sensation, discomfort that worsens on an empty stomach: these describe both peptic ulcer disease and a far more common condition called non-ulcer dyspepsia. Non-ulcer dyspepsia is diagnosed at least twice as often as actual peptic ulceration. People experiencing it have a stomach that looks perfectly healthy on endoscopy but still hurts.

Studies comparing the stomach’s muscular activity in ulcer patients and non-ulcer dyspepsia patients have found that both groups show reduced contractions during the fasting state compared with healthy controls. In other words, the symptom overlap is not just subjective. The motor behavior of the stomach is genuinely abnormal in both conditions, even though only one involves actual tissue damage. This means that if fasting makes your stomach feel terrible, the odds strongly favor dyspepsia over a new ulcer. That is reassuring in one sense but frustrating in another, because the discomfort is real either way.

The practical takeaway: recurring stomach pain triggered by fasting warrants investigation, but it does not mean you are developing an ulcer. If the pain consistently resolves within minutes of eating and you have no alarm symptoms like vomiting blood, unexplained weight loss, or dark stools, dyspepsia is much more likely. Of course, none of that replaces an actual medical evaluation if symptoms persist.

The Brain-Stomach Connection During Fasting

Your stomach starts producing more acid before food even arrives. Just anticipating a meal, smelling cooking, or looking at appealing food triggers what is known as the cephalic phase of digestion. In one study, men who knew a meal was coming showed a progressive rise in acid secretion that reached roughly 55% of the maximum acid output their stomachs could produce, and this happened before any food touched their lips. The response was driven by the brain, not by blood sugar or the hormone gastrin.

This has a direct implication for anyone who fasts while surrounded by food cues, which is most of us. If you are doing a 16:8 intermittent fast but spending the morning watching cooking videos or sitting in a break room where colleagues are eating, your stomach is getting revved up with no food to absorb the acid. The result is not an ulcer, but it can mean more discomfort than you would feel if you fasted in a setting without constant food reminders. People who fast during Ramadan and then prepare elaborate iftar meals while still fasting are experiencing this effect at full force.

Circadian Rhythms and Stomach Vulnerability

Your stomach does not produce acid at a steady rate around the clock. Both acid secretion and the protective bicarbonate secretion follow circadian rhythms, and their peaks do not line up. In fasting rats, acid output peaked in the early morning hours, while bicarbonate peaked hours later in the late morning. The mismatch means there are windows when the ratio of aggressive to defensive factors in the stomach shifts unfavorably. Blood flow to the stomach lining, another key defensive factor, also follows its own circadian pattern, with peak flow in the stomach body occurring in the early morning hours.

These are animal data, and human circadian gastric physiology may differ in timing. But the principle is relevant: the stomach is not equally well-defended at all hours. If you have a vulnerable stomach lining, whether from H. pylori, chronic NSAID use, or some other cause, the timing of your fast relative to your body’s internal clock could, at least in theory, influence how much trouble you get into. This is one reason people with active ulcers sometimes report that nighttime and early morning are when symptoms flare worst.

Stress, Fasting, and Stomach Erosions

The old idea that “stress causes ulcers” has been largely overturned since the discovery of H. pylori in the 1980s, but the relationship between psychological stress and stomach damage is not zero. It is just more nuanced than people once thought.

One line of research has produced a surprising finding: the stress hormone response may actually protect the stomach lining, at least during acute stress. When researchers administered corticotropin-releasing factor (the hormone that kicks off the stress response) to rats before exposing them to cold-restraint stress, it sharply reduced gastric erosions. Blocking the resulting rise in corticosterone reversed that protection, suggesting glucocorticoids released during acute stress function as gastroprotective agents rather than ulcer-causing ones. This flips the conventional wisdom. Short-term stress may rally defenses rather than erode them.

The picture changes with severe, sustained physiological stress. In animal models of prolonged restraint and cold exposure, the stomach develops erosions driven primarily by ischemia: the stomach’s own contractions compress blood vessels in the lining, cutting off oxygen to the tissue. These “stress ulcers” are a real phenomenon in intensive care units, where critically ill patients face the combination of extreme physiological stress, impaired blood flow, and disrupted eating. They are not the same thing as the peptic ulcers that everyday fasters worry about.

So if you are wondering whether the mild psychological stress of being hungry will give you an ulcer, the answer is no. The stress response during ordinary fasting is not in the same universe as the stress that produces ICU-type erosions. If anything, the acute cortisol bump from missing a meal is more likely to bolster your stomach’s defenses than undermine them.

What About Longer Fasts and Autophagy

Proponents of extended fasting sometimes point to autophagy, the body’s cellular cleanup process, as a reason fasting might actually heal the gut. Autophagy is activated when cells are deprived of nutrients, and it plays a documented role in repairing organ dysfunction. Research on critically ill patients has suggested that withholding full nutritional support in the acute phase of illness can stimulate autophagy and accelerate recovery. However, drawing a straight line from “autophagy exists” to “fasting heals ulcers” is a leap the evidence does not support. The studies on autophagy and gut repair are largely in the context of critical illness, not in otherwise healthy people skipping meals.

Comparative biology offers an intriguing angle. Hibernating animals go months without eating, yet their gut linings do not deteriorate. Research on hibernating species has shown that their intestinal tissue undergoes protective adaptations, including changes to immune signaling and cell survival pathways, that confer resistance to the kind of ischemia-reperfusion injury that would damage non-hibernating tissue. Human stomachs are not adapted for hibernation, so these findings do not directly translate. But they do illustrate that prolonged fasting and gut integrity are not inherently incompatible in biology. The stomach is not so fragile that simply going without food destroys it.

Coffee, Tea, and Other Fasting Companions

Many people who practice intermittent fasting drink black coffee or tea during their fasting window. Coffee stimulates gastric acid secretion, which is why it can make an empty stomach feel worse. However, the evidence linking coffee to actual peptic ulcer formation remains unsettled. A narrative review of the literature found that coffee’s potential to affect ulcers and other inflammatory conditions of the digestive tract is still controversial, with studies pointing in different directions.

If coffee on an empty stomach gives you heartburn or an upset stomach, that is your stomach telling you the extra acid stimulation is not welcome right now. It does not mean coffee is giving you an ulcer, but it does mean you are pushing an already acidic environment further in a direction that causes discomfort. Switching to a less acidic beverage during the fasting window, or simply drinking water, is an easy fix for people who find their fasts are sabotaged by stomach symptoms.

Who Should Think Twice Before Fasting

For most healthy adults, intermittent fasting or religious fasting poses no meaningful ulcer risk. The stomach is designed to handle extended periods without food. But certain groups face a different risk calculation:

  • Active ulcer patients: If you have a known, untreated peptic ulcer, fasting can worsen bleeding or raise the risk of perforation, as the Ramadan studies suggest. Get the ulcer treated before taking on prolonged fasts.
  • Regular NSAID users: Taking anti-inflammatory drugs on an empty stomach removes the food buffer while the drug is simultaneously weakening the mucus barrier. If you cannot shift the medication to your eating window, talk to a doctor about adding a PPI.
  • People with untreated H. pylori: Fasting does not cause the infection, but the altered gastric environment during fasting may allow the bacteria to become more active. Treating the infection first is a safer approach.
  • Those on blood thinners: Anticoagulant use combined with any of the above factors raises the stakes for a bleeding event. Medical guidance on fasting is especially important here.

The review on fasting and H. pylori-induced ulcers specifically noted that people with uncomplicated ulcers can participate in fasts as long as they take recommended precautions. “Uncomplicated” is doing real work in that sentence: it means the ulcer has been diagnosed, treated, and is not actively bleeding or at high risk of perforation. The distinction between an uncomplicated and a complicated ulcer is exactly the kind of thing that requires a doctor’s assessment, not a guess based on how your stomach feels.