Why Do I Get Heartburn When I Haven’t Eaten?

Your stomach produces acid around the clock, whether or not you have eaten anything. When food is present, it absorbs and dilutes much of that acid. When the stomach is empty, the acid has nothing to work on, and the body’s usual defenses against it slow down considerably. That mismatch between constant acid production and reduced protection is the core reason heartburn can flare on an empty stomach, and several overlapping mechanisms make it worse than you might expect.

Your Stomach Never Stops Making Acid

A common assumption is that the stomach ramps up acid only when food arrives or when you smell something cooking. In reality, there is a baseline level of acid secretion that continues all day and night, independent of meals. Research in healthy volunteers has confirmed a circadian rhythm in unstimulated gastric acid secretion, meaning your stomach follows a roughly 24-hour cycle of acid output even when no food or other stimulation is present.1PubMed. Circadian rhythm of gastric acid secretion in active duodenal ulcer: chronobiological statistical characteristics and comparison of acid secretory and plasma gastrin patterns with healthy subjects and postvagotomy and pyloroplasty patients This cycle tends to peak in the late evening and overnight, which partly explains why heartburn can wake people up or greet them first thing in the morning.

What makes this worse is that the rhythm appears to be independent of gastrin, the hormone typically thought to drive acid production after a meal. So the acid your stomach produces while empty is not a leftover response to your last meal. It is a separate, ongoing process built into the body’s daily clock. With nothing in the stomach to soak it up, that acid sits in a pool at the bottom of the stomach, and any movement that brings it close to the junction between the stomach and the esophagus can push it upward.

Why Fasting Leaves Your Esophagus Vulnerable

Even when acid does splash up into the esophagus, your body normally has a cleanup crew ready. Swallowing pushes acid back down. Saliva, which is mildly alkaline, neutralizes whatever clings to the esophageal lining. Rhythmic muscular contractions called peristalsis sweep the esophagus clean. All of these processes, though, are stimulated by the act of eating. When you are fasting, every one of them slows down.

Research on acid clearance during fasting found that the efficiency of these esophageal defenses drops substantially when no food is being consumed, likely because salivation, swallowing frequency, and peristalsis all decrease.2PubMed. Diurnal variation in the chemical clearance of acid gastroesophageal reflux in infants The result is that even a brief splash of acid into the esophagus lingers longer than it would after a meal. A reflux episode that your body would normally clear in seconds during a meal might sit in the esophagus for minutes during a fast. That extended contact time is what produces the burning sensation.

Sleep makes this even worse, since you swallow far less while asleep and produce almost no saliva. If acid refluxes into the esophagus overnight, it can sit there for long stretches with almost no neutralization happening. This is one reason people who skip dinner or eat very early sometimes wake up with heartburn despite not having eaten anything remotely triggering.

The Gut’s Fasting Cleaning Cycle

Your digestive tract has a housekeeping routine that only runs during fasting. Called the migrating motor complex, it is a pattern of strong, wave-like contractions that sweeps through the stomach and small intestine roughly every one to two hours when you have not eaten. Its purpose is to clear leftover debris, bacteria, and secretions from the gut. But it has a side effect that is directly relevant to heartburn.

A study measuring gastric motor activity and reflux simultaneously found that roughly 89% of nighttime and 83% of daytime fasting motor cycles were accompanied by episodes of acid reflux into the esophagus. During nighttime fasting, these motor cycles were associated with a 100-fold increase in esophageal acid exposure compared to the quiet periods between cycles.3PubMed Central. Gastro-oesophageal reflux and the migrating motor complex During the day, the same pattern held but with a smaller, roughly threefold increase in acid exposure.

The contractions recurred about every 78 minutes at night and every 131 minutes during the day.3PubMed Central. Gastro-oesophageal reflux and the migrating motor complex So there is a built-in, cyclical mechanism that periodically pushes stomach contents, including acid, upward toward the esophagus during fasting. If you have ever noticed that empty-stomach heartburn seems to come in waves rather than being constant, this cycle may be why.

Coffee, Caffeine, and the Empty Stomach

One of the most common scenarios for empty-stomach heartburn is morning coffee before breakfast. People often blame caffeine, and it does play a role, but the relationship is more complicated than the simple story suggests.

Caffeine itself has been shown to lower the resting pressure of the valve between the esophagus and stomach. A study in healthy volunteers found that caffeine at a moderate dose significantly reduced this pressure within 10 to 25 minutes of consumption, which is known to make it easier for stomach acid to move upward.4PubMed. Effect of caffeine on lower esophageal sphincter pressure in Thai healthy volunteers On an empty stomach, where acid is undiluted and esophageal clearance is already sluggish, this pressure drop can tip the balance toward reflux.

But here is where it gets interesting: coffee stimulates acid production far beyond what caffeine alone does, and switching to decaf does not solve the problem. Research comparing regular coffee, decaffeinated coffee, and pure caffeine found that both regular and decaf coffee triggered substantially more acid secretion than caffeine by itself.5PubMed. Gastric acid secretion and lower-esophageal-sphincter pressure in response to coffee and caffeine Something else in coffee beyond caffeine is driving the acid response. So if you are getting heartburn from coffee on an empty stomach, switching to decaf may reduce the valve-loosening effect of caffeine but will do little about the extra acid your stomach is producing in response to the drink itself.

When Stress Is the Real Trigger

Some people notice that empty-stomach heartburn gets much worse during high-stress periods, even when their diet has not changed. This is not imagined. Stress appears to amplify heartburn through multiple pathways, and one of the more surprising ones has less to do with acid volume than with how your esophagus perceives the acid that is already there.

Research on the relationship between life stress and heartburn symptoms identified several mechanisms that could link the two. These include increased frequency of acid reaching the esophagus, slower clearing of acid from the stomach, and stress-induced hypersensitivity, where the esophagus becomes more reactive to the same amount of acid that would not normally cause symptoms.6PubMed. The effect of life stress on symptoms of heartburn In other words, stress can turn up the volume on signals that your brain would otherwise ignore.

This helps explain a frustrating pattern many people describe: heartburn that flares during anxious mornings or stressful workdays, often before they have eaten anything. It is not necessarily that they are producing dramatically more acid. Their esophagus is just more sensitive to whatever acid is present. Combining that heightened sensitivity with the reduced clearance that comes with fasting and you have a recipe for symptoms that feel outsized relative to what is actually happening in the gut.

When Empty-Stomach Burning Points to Something Else

Occasional fasting heartburn is common and usually harmless. But burning pain on an empty stomach that happens regularly, especially if it improves after eating, can be a sign of something more specific. One of the most well-documented causes is infection with H. pylori, the bacterium that causes most stomach ulcers.

A retrospective study comparing patients who tested positive and negative for H. pylori found that burning pain in the upper abdomen that worsens on an empty stomach was reported by about three-quarters of those who tested positive, compared to only about 4% of those who tested negative.7PubMed Central. Association Between Dyspeptic Symptoms and Helicobacter pylori Stool Antigen Positivity: A Retrospective Study That is a striking difference. The symptom was specific enough to correctly identify the infection roughly 96% of the time when it was present.

This does not mean that everyone with empty-stomach heartburn has an H. pylori infection. It does mean that if the pattern is consistent, getting tested is worthwhile. The infection is treatable with a short course of antibiotics, and resolving it often eliminates the symptom entirely. If you are reaching for antacids every time your stomach is empty and finding only temporary relief, the underlying cause may be bacterial rather than dietary.

Medications That Backfire

Two categories of medication deserve attention here, because they can make empty-stomach heartburn worse in ways people do not always connect to the drug.

The first is anti-inflammatory painkillers like ibuprofen and naproxen. These drugs work by blocking enzymes involved in inflammation, but those same enzymes also produce substances that protect the stomach lining. Taking these medications reduces the stomach’s ability to defend itself against its own acid.8PubMed Central. Effects of Non-steroidal Anti-inflammatory Drugs (NSAIDs) and Gastroprotective NSAIDs on the Gastrointestinal Tract: A Narrative Review Taking them on an empty stomach is particularly problematic because there is no food to buffer the acid from the now-less-protected lining. The standard advice to take these drugs with food exists for exactly this reason.

The second and more counterintuitive category is acid-suppressing drugs themselves, specifically proton pump inhibitors. These medications are highly effective at reducing acid production while you are taking them. But after long-term use, stopping them can trigger a rebound effect where the stomach temporarily produces significantly more acid than it did before you started treatment.9PubMed Central. Rebound Acid Hypersecretion after Withdrawal of Long-Term Proton Pump Inhibitor (PPI) Treatment-Are PPIs Addictive? People who quit these drugs abruptly often experience worse heartburn than they had originally, especially on an empty stomach when there is nothing to dilute the surge in acid. This rebound can create a cycle where people restart the medication believing their condition has worsened, when the symptoms are actually a withdrawal effect. Tapering gradually, rather than stopping cold, helps minimize this.

Anatomy and the Valve That Does Not Seal

The valve between your esophagus and stomach is not really a valve in the mechanical sense. It is a ring of muscle that stays contracted most of the time, opening only when you swallow. In some people, this muscle relaxes at the wrong moments, allowing acid to escape upward. These transient relaxations are actually the primary mechanism behind most reflux episodes, not a permanently weak valve.10PubMed. Effect of morphine on gastroesophageal reflux and transient lower esophageal sphincter relaxation

Anatomy can also stack the deck. A hiatal hernia, where part of the stomach pushes up through the diaphragm into the chest cavity, weakens the barrier between stomach and esophagus. Patients with a hiatal hernia have been found to have measurably lower resting pressure at this junction and significantly more reflux episodes in both upright and lying-down positions compared to reflux patients without a hernia.11Diseases of the Esophagus. Similar symptom patterns in gastroesophageal reflux patients with and without hiatal hernia If you have a hernia and an empty stomach, the combination of low valve pressure and undiluted acid sitting in the stomach makes reflux episodes more likely and more uncomfortable.

Hiatal hernias are surprisingly common, especially as people age, and many people have small ones without knowing it. They do not always require treatment, but if empty-stomach heartburn is a recurring problem and basic dietary adjustments are not helping, a hernia is one of the structural factors worth investigating.

What Actually Helps

Understanding the mechanisms behind fasting heartburn points toward practical strategies that go beyond the usual “avoid spicy food” advice. Eating small, frequent meals keeps the stomach from being completely empty for extended periods and ensures that acid has something to work on rather than sitting idle. If you tend to get heartburn overnight or first thing in the morning, a small snack in the evening can help buffer overnight acid production.

If morning coffee is a trigger, pairing it with food rather than drinking it on an empty stomach addresses both the acid-stimulating and valve-loosening effects. Staying upright for a while after waking and avoiding lying back down after coffee also reduces the physical opportunity for acid to travel upward.

For stress-related flares, the evidence suggests that simply suppressing acid may not fully address the problem, since part of the issue is heightened sensitivity rather than excess acid. Stress management approaches can reduce the esophagus’s reactivity independently of acid levels. And for anyone whose empty-stomach burning is persistent and predictable, particularly if it reliably improves with food, getting tested for H. pylori is one of the most efficient diagnostic steps available.

Why Human Stomachs Are So Acidic in the First Place

One question that rarely gets asked is why the stomach needs to be so hostile to begin with. Human gastric acid is remarkably strong, with a pH level close to that of scavenger species that eat decaying meat.12PubMed Central. Gastric acid level of humans must decrease in the future The leading explanation is that our ancestors relied heavily on scavenging as a food source, and a highly acidic stomach served as a chemical barrier against the bacteria present in carrion. Maintaining that acid level requires significant energy, and the body invests in a thick mucus lining and bicarbonate secretion just to keep the stomach from digesting itself.

From an evolutionary standpoint, the body was designed to handle this acid when the stomach was regularly full of food. The modern pattern of long gaps between meals, late-night fasting, and stimulant beverages on empty stomachs is not what the system was built for. That mismatch between our ancient acid-production machinery and modern eating habits is, in many ways, the fundamental reason empty-stomach heartburn is so common. The stomach has not received the memo that we no longer need to sterilize scavenged meat.