Why Does My Stomach Only Hurt at Night?

Your stomach likely hurts at night because several biological systems converge after dark to create a perfect storm for digestive discomfort. Acid production in your stomach follows a circadian rhythm that peaks in the evening and overnight hours, and lying down removes gravity’s help in keeping that acid where it belongs. Add an empty stomach, changed gut motility, and the simple fact that your brain has fewer distractions competing with pain signals, and nighttime becomes prime time for stomachaches. The specific cause varies from person to person, but understanding which of these mechanisms is driving your pain can point you toward relief.

Your Stomach Makes More Acid After Dark

Gastric acid secretion is not constant throughout the day. Research on both healthy people and those with digestive conditions consistently shows that acid output climbs in the evening and remains elevated through much of the night. One study of men with duodenal ulcers found that acid rates were highest during the evening and lowest in the early morning hours, a pattern driven by the body’s internal clock rather than food intake alone.1PubMed. Circadian rhythm of gastric acid secretion in men with active duodenal ulcer Separate research using continuous pH monitoring confirmed that intragastric acidity tends to rise from the middle of the night through early dawn, then drop off in the morning, regardless of whether someone carries H. pylori infection.2Biomedicine & Pharmacotherapy. Intragastric acidity and circadian rhythm

This means that even if you ate the same meal at noon and at 8 p.m., your stomach would be bathing in more acid during the nighttime hours. For anyone with an already irritated stomach lining, a healing ulcer, or a tendency toward acid reflux, this nightly acid surge alone can be enough to cause pain.

Lying Down Lets Acid Travel the Wrong Way

When you stand or sit upright, gravity helps keep stomach contents in the stomach. Lie flat, and that advantage disappears. For people prone to gastroesophageal reflux, this is the single biggest reason nighttime feels worse. Acid that might stay put during the day can creep up into the esophagus once you are horizontal, producing burning pain in your upper abdomen or chest. The longer you are lying down, the more time acid has to make contact with tissue that was not designed to handle it.

Reflux during sleep is particularly problematic because you swallow less often when asleep. Swallowing normally pushes escaped acid back down and introduces saliva, which helps neutralize it. During deep sleep, that protective reflex slows dramatically. The result is that refluxed acid sits in the esophagus longer, causing more irritation per episode than an identical reflux event during the day.

If your nighttime stomach pain is accompanied by a sour taste, chest burning, or a sensation of something rising in your throat, reflux is a strong suspect. Eating large or fatty meals close to bedtime makes this worse, as does alcohol, which relaxes the muscular valve between your stomach and esophagus.

Sleep Position Matters More Than You Think

Not all sleeping positions are created equal when it comes to reflux. A systematic review and meta-analysis looking at how body position during sleep affects acid exposure found that sleeping on your left side significantly reduced both the total time acid spent in the esophagus and the number of acid contacts compared to sleeping on your right side or on your back.3PubMed Central. Left lateral decubitus sleeping position is associated with improved gastroesophageal reflux disease symptoms: A systematic review and meta-analysis Sleeping on your right side performed no better than lying flat on your back. One randomized trial included in that review used an electronic device to nudge sleepers onto their left side more often, and participants reported more reflux-free nights and resolution of nocturnal reflux symptoms as a result.

The anatomy behind this is straightforward. When you lie on your left side, the stomach hangs below the esophageal junction, and the pool of acid sits in the lower curve of the stomach, away from the opening. Roll to your right, and that pool shifts to sit right against the valve. If you have been waking up with stomach pain and you tend to sleep on your right side or your back, switching to your left side is one of the simplest changes worth trying. Elevating the head of your bed by a few inches can add another layer of gravity-assisted protection.

The Empty Stomach Problem

Many people eat dinner around 6 or 7 p.m. and do not eat again until morning. By midnight or later, the stomach has emptied its contents, but acid secretion continues at its elevated nighttime rate. This leaves acid with nothing to work on except the stomach lining itself. The pain that results often feels gnawing or burning and may actually improve temporarily if you eat a small snack, which is a hallmark clue that an empty, acidic stomach is the culprit.

This pattern is classic in peptic ulcer disease, where a break in the stomach or duodenal lining gets irritated by acid. People with duodenal ulcers in particular often describe pain that wakes them between midnight and 3 a.m., eases after eating, and returns once the stomach empties again. But you do not need an ulcer for empty-stomach acid to cause trouble. Functional dyspepsia, a condition where the stomach is overly sensitive to normal amounts of acid, can produce similar nighttime gnawing even when the lining looks perfectly healthy on an endoscopy.

If this pattern sounds familiar, a light snack before bed that includes some protein or complex carbohydrates can buffer acid without triggering a heavy digestive workload. Avoid reaching for something acidic or spicy, which would only compound the issue.

Your Gut Slows Down While You Sleep

The digestive tract does not shut off during sleep, but it operates differently. Research on gut motility during sleep shows that nighttime intestinal contractions become more regular but simpler in pattern, and the speed at which the cyclical cleaning waves of the small bowel travel is slower at night than during the day.4PubMed. Aspects of sleep effects on the digestive tract One particular phase of the normal motility cycle, the irregular contractions that mix and move food remnants, is virtually absent during sleep.

For most people, this slowed-down operation is harmless. But if you have a condition that already impairs motility, such as gastroparesis or certain types of functional dyspepsia, the nighttime slowdown can tip you over the edge. Food that should have cleared the stomach hours earlier may still be sitting there, producing bloating, nausea, or a heavy, uncomfortable feeling. People with gastroparesis often report that symptoms are worst in the late evening and overnight, precisely because the stomach is already slow to empty and the nighttime motility reduction compounds the delay.

Your Brain Amplifies Pain When Everything Else Goes Quiet

There is a reason pain of all kinds tends to feel worse at night, and it is not just that you are more aware of it without the distractions of the day. The brain-gut connection plays an active role. Signals from the digestive tract travel through nerves in the spinal cord to the brain, where they are processed and experienced as pain. In people with irritable bowel syndrome, the brain’s response to these gut signals is amplified, a phenomenon researchers call visceral hypersensitivity.5PubMed Central. The Importance of Visceral Hypersensitivity in Irritable Bowel Syndrome-Plant Metabolites in IBS Treatment Normal amounts of gas or normal contractions that a healthy gut would barely register get interpreted as painful.

At night, competing sensory input drops away. You are not walking, talking, working, or looking at screens. The brain’s attention narrows, and signals from the gut that were drowned out during the day get a clearer channel to conscious awareness. For someone with visceral hypersensitivity, this can turn a tolerable daytime grumble into a sharp nighttime ache. Stress and anxiety, which tend to peak during the quiet of bedtime for many people, further sensitize this pathway. If you have ever noticed that your stomach pain flares on nights when you are anxious or ruminating, this brain-gut amplification is a likely contributor.

Poor Sleep and Gut Health Feed Each Other

The relationship between sleep and digestive symptoms runs in both directions. Pain disrupts sleep, but insufficient or poor-quality sleep can also make digestive symptoms worse. Animal research has shown that sleep deprivation damages the protective mucus layer of the intestines and reduces the levels of tight junction proteins that hold the gut lining together, essentially making the gut barrier leakier.6PubMed. Sleep Deprivation Impairs Intestinal Mucosal Barrier by Activating Endoplasmic Reticulum Stress in Goblet Cells The cells responsible for producing protective mucus were particularly affected, with their numbers and mucin output dropping significantly under sleep-deprived conditions.

While these findings come from animal models and the exact translation to humans is still being studied, the clinical pattern is consistent. People who sleep poorly tend to report worse digestive symptoms, and people with chronic digestive conditions tend to sleep poorly. This creates a feedback loop that can be hard to break. Addressing sleep quality directly through consistent sleep timing, reduced screen exposure before bed, and treating sleep disorders like apnea may improve gut symptoms even before any digestive-specific treatment is tried.

The gut microbiome adds another layer. The composition and metabolic activity of gut bacteria follow their own circadian rhythms, influenced by when and what you eat.7International Review of Neurobiology. Circadian Rhythm and the Gut Microbiome Disrupting these rhythms through irregular eating schedules or poor sleep can shift the microbial community in ways that affect immune function and metabolism. The science here is still evolving, but it suggests that keeping a regular schedule benefits your gut at a level deeper than just acid production.

What Shift Work Reveals About Circadian Disruption and Gut Pain

Some of the most striking evidence for how circadian disruption affects the gut comes from studies of shift workers. Nurses who worked rotating shifts, constantly flipping between day and night schedules, had a significantly higher prevalence of irritable bowel syndrome compared to nurses who worked only day shifts. Nearly half of rotating shift nurses met criteria for IBS, compared to about a third of day-shift nurses. The difference in abdominal pain was even more pronounced: roughly four out of five rotating shift nurses reported abdominal pain, compared to just over half of their day-shift colleagues.8PubMed Central. The impact of rotating shift work on the prevalence of irritable bowel syndrome in nurses This association held up even after accounting for differences in age, sex, and sleep quality.

You do not have to be a shift worker for this to be relevant. Anyone who keeps irregular hours, eats meals at wildly different times from day to day, or stays up very late on weekends and reverts to an early schedule on workdays is creating a milder version of the same circadian mismatch. If your nighttime stomach pain tends to be worse on nights when your schedule has been disrupted, the circadian link is worth paying attention to. Stabilizing your meal and sleep times, even roughly, can reduce the gut’s confusion about when to ramp up acid, when to trigger motility, and when to quiet down.

Swallowed Air and Nighttime Bloating

Not all nighttime stomach pain is about acid or motility. Some people experience bloating, pressure, or cramping from gas that builds up during the night. One under-recognized cause is aerophagia, the unconscious swallowing of air. Everyone swallows some air, but people who breathe through their mouths during sleep, snore heavily, or use a CPAP machine for sleep apnea can swallow substantially more.

A study of CPAP users found that flatulence was the most bothersome gastrointestinal symptom and worsened significantly during CPAP use, with reported severity rising by about 40 percent compared to before starting therapy.9PubMed Central. Gastrointestinal symptoms and CPAP-related aerophagia: A questionnaire study Dry mouth also worsened substantially. While heartburn and belching actually decreased slightly on CPAP, the bloating and gas were bothersome enough that some patients abandoned the therapy altogether. If you use a CPAP and have noticed new stomach discomfort at night, adjusting pressure settings with your sleep specialist or trying a different mask style can help reduce air swallowing without giving up the breathing benefits.

Even without a CPAP, people with nasal congestion, allergies, or a deviated septum who default to mouth breathing at night may swallow enough air to wake with abdominal distension or cramping. The pain is usually diffuse rather than localized, feels more like pressure than burning, and often resolves after passing gas or belching in the morning. Addressing the underlying cause of mouth breathing, whether through allergy treatment, nasal strips, or an evaluation for structural issues, can make a noticeable difference.

When Nighttime Stomach Pain Needs a Doctor

Occasional nighttime stomach discomfort after a heavy meal or a stressful day is common and rarely signals something serious. But certain patterns warrant a medical evaluation rather than self-management. Pain that wakes you from sleep on a regular basis is more clinically significant than pain you notice while falling asleep, because it means the signal is strong enough to override your sleep drive. Unintentional weight loss paired with nighttime pain raises the possibility of conditions beyond simple acid irritation. Black or tarry stools suggest bleeding somewhere in the upper digestive tract, which can accompany ulcers that have eroded into a blood vessel. Persistent vomiting, especially if it contains blood or material that looks like coffee grounds, is another red flag.

Pain that has been present for more than two to three weeks despite basic measures like adjusting meal timing, sleeping on your left side, and avoiding late-night eating deserves investigation. Your doctor can check for H. pylori infection, which is a treatable bacterial cause of ulcers and chronic gastritis, and can order imaging or endoscopy if the pattern suggests something structural. Many people put up with nighttime stomach pain for months or years, assuming it is just stress or something they ate, when a straightforward diagnosis and treatment could resolve it. If the pain is affecting your sleep quality, that alone is reason enough to bring it up, because the sleep-gut feedback loop described earlier means that letting it go untreated tends to make both the sleep and the stomach progressively worse.