What Causes Stomach Pain Only When Lying Down?

Stomach pain that appears or worsens specifically when you lie down almost always traces back to a shift in how gravity, pressure, and anatomy interact once you go horizontal. The most common culprit is acid reflux, but it is far from the only one. Trapped intestinal gas, nerve entrapment in the abdominal wall, medication lodged in the esophagus, and even cardiac inflammation can all produce pain that shows up primarily in a supine position. Understanding which mechanism is at play matters, because the fixes are different for each.

Acid Reflux Loses Its Best Defense

When you stand or sit upright, gravity does a lot of quiet work keeping stomach acid where it belongs. The moment you lie flat, that advantage disappears. Acid can pool against the lower esophageal sphincter (the muscular valve between your esophagus and stomach) and, if that sphincter is weak or relaxes at the wrong time, wash upward into the esophagus. The result is a burning or gnawing pain in the upper abdomen or lower chest that people often describe as “stomach pain,” even though the irritation is technically happening above the stomach.

Research on how body position affects esophageal pressures adds a useful wrinkle. One study using high-resolution manometry found that a key pressure measurement at the junction of the esophagus and stomach was significantly higher in the supine position than when sitting upright, which sounds like it should be protective. But higher resting pressure doesn’t necessarily prevent transient relaxations of the sphincter, and those brief openings are the main route for acid to escape.1PubMed Central. Effects of body position on high-resolution manometry parameters and their correlations with symptoms Similarly, both upper and lower esophageal sphincter pressures increase when lying supine compared to standing, yet reflux episodes still climb in the flat position because gravity is no longer clearing acid back down once it escapes.2PubMed Central. Impact of arm position and load on upper and lower esophageal sphincter pressures

This is why nighttime reflux can feel so much worse than daytime episodes. During the day, every swallow sends a small wave of saliva downward, rinsing acid off the esophageal lining. At night, swallowing slows dramatically, and you produce less saliva. Combined with the loss of gravity, acid contact time with the esophagus can be several times longer than during waking hours. If your “stomach pain when lying down” is really a burning sensation behind the breastbone or in the upper abdomen that arrives within 30 minutes of going to bed, reflux is the leading suspect.

Trapped Gas and Bloating in the Supine Position

Intestinal gas moves through the gut partly by gravity and partly by peristalsis, the rhythmic muscular contractions of the intestinal wall. When you lie flat, gravity stops helping gas migrate toward the exit, and pockets of gas can become trapped at bends in the colon. One well-described pattern involves the splenic flexure, the sharp turn in the colon just below the left rib cage, where gas accumulates when posture changes reduce the natural downward pull.3PubMed Central. Bloating in a supine position The trapped gas distends the bowel wall locally, producing crampy or pressure-like pain that can feel alarmingly intense.

This kind of pain tends to be more diffuse or left-sided compared with the central burning of reflux. It often comes with visible bloating that gets worse after meals, especially meals high in fermentable carbohydrates. Some people notice relief when they shift to their side or get up and walk around, which repositions the gas and lets it move. If your lying-down pain feels like pressure or fullness rather than burning, and it improves when you change position or pass gas, trapped intestinal gas is a likely explanation.

Abdominal Wall Nerve Entrapment

Not all abdominal pain originates inside the abdomen. Abdominal cutaneous nerve entrapment syndrome, commonly called ACNES, happens when small nerves that pass through the front abdominal muscles get pinched or irritated. The pain is typically sharp, well-localized to a specific spot on the belly, and it gets worse with movements or postures that stretch or tense the abdominal wall.4PubMed Central. Abdominal Cutaneous Nerve Entrapment Syndrome (ACNES): A Commonly Overlooked Cause of Abdominal Pain

Lying supine is one of the postures that can trigger or worsen ACNES pain, because the abdominal muscles change tension when you go flat. A classic diagnostic clue is Carnett’s sign: if a doctor presses on the tender spot while you tense your belly muscles (like doing a small crunch), the pain stays the same or gets worse rather than fading. Pain that originates from an organ inside the abdomen typically gets duller when the muscles tighten over it, because the contracted muscle acts as a shield. With ACNES, the nerve is in the muscle itself, so tensing makes things worse.

ACNES is frequently overlooked because imaging and blood work come back normal, leading some patients through months of unnecessary testing. If you have a single tender spot that hurts more when you lie down or roll over in bed, and no one has been able to explain it, this diagnosis is worth raising with your doctor.

Pill Esophagitis

This one catches people off guard. If you take a pill with little or no water and then immediately lie down, the pill can lodge partway down the esophagus and slowly dissolve against the lining. Certain medications are especially corrosive to esophageal tissue: anti-inflammatory drugs, some antibiotics like doxycycline, bisphosphonates used for bone density, and even common over-the-counter antihistamines. A case report documented a patient who developed esophageal ulceration after taking an antihistamine tablet without liquid right before going to bed.5PubMed Central. Desloratadine Induced Pill Esophagitis

The pain from pill esophagitis typically arrives hours after taking the medication, often waking you in the middle of the night. It can feel like a sudden, intense burning or aching in the mid-chest or upper abdomen, and it sometimes hurts to swallow for days afterward. The fix is simple once you know the cause: take pills with a full glass of water and remain upright for at least 15 to 30 minutes before lying down. If you have been waking up with new upper abdominal or chest pain and you take medications at bedtime, consider whether this could be the link.

Intra-Abdominal Pressure and Body Weight

Carrying extra weight around the midsection raises the baseline pressure inside the abdomen. Research on morbidly obese patients found that intra-abdominal pressure correlated strongly with sagittal abdominal diameter, which is essentially a measure of how much the belly protrudes front to back.6PubMed. Intra-abdominal pressure in the morbidly obese When someone with elevated intra-abdominal pressure lies down, the pressure doesn’t drop the way it might in a leaner person. Instead, the weight of abdominal fat compresses the stomach and intestines against the diaphragm and spine, which can worsen reflux, increase trapped gas discomfort, and create a general sensation of tightness or aching.

This effect is one reason why weight loss is consistently one of the most effective long-term interventions for nighttime reflux and supine abdominal discomfort. It also explains why some people who never had nighttime stomach pain begin experiencing it after significant weight gain, particularly if the weight accumulates centrally rather than in the hips and legs.

Functional Dyspepsia and Visceral Hypersensitivity

Some people have stomach pain that defies a tidy structural explanation. Functional dyspepsia is the term for chronic upper abdominal pain or discomfort where endoscopy and standard testing reveal nothing obviously wrong. One of the leading theories behind it involves visceral hypersensitivity, a state in which the nerves lining the stomach and intestines overreact to normal stimuli like mild stretching or ordinary amounts of acid.7PubMed Central. Functional dyspepsia: the role of visceral hypersensitivity in its pathogenesis

For someone with visceral hypersensitivity, lying down can amplify signals that a normal gut would ignore. The slight redistribution of stomach contents, the modest change in gas dynamics, the small increase in acid contact with the stomach lining, all of these become pain signals that the brain interprets as something wrong. People with functional dyspepsia often notice that stress and anxiety worsen the problem, which makes sense because the brain-gut connection runs both ways: emotional states can dial visceral sensitivity up, and gut discomfort can increase anxiety.

If your lying-down stomach pain has been investigated with imaging, blood tests, and perhaps an endoscopy, and everything comes back normal, functional dyspepsia is a real and recognized diagnosis. Treatments range from low-dose antidepressants that calm visceral nerve signaling to dietary modifications and psychological therapies like cognitive behavioral therapy.

When It’s Not the Stomach at All

A handful of conditions outside the gastrointestinal tract produce pain that feels like it’s in the stomach but actually originates elsewhere. The most important one to recognize is pericarditis, an inflammation of the sac surrounding the heart. Pericarditis classically causes chest pain that worsens when lying flat and improves when you sit up and lean forward. In some presentations, the pain radiates to the upper abdomen or is felt primarily there, leading patients to assume it’s a stomach problem. One documented case described a patient whose pain was located in the right upper part of the abdomen along with chest pain, and the pain worsened on deep breathing and lying flat but eased when sitting up and leaning forward.8Cardiology: Open Access. Management of Resistant Pericarditis in an End Stage Renal Disease Patient – Case Presentation

Pericarditis pain typically comes on more suddenly than reflux or gas, and it often has a sharp, stabbing quality. If lying flat makes your pain noticeably worse and sitting up with a forward lean brings quick relief, and especially if you’ve recently had a viral illness or respiratory infection, seek medical attention rather than assuming it’s digestive. An electrocardiogram and some basic blood work can usually confirm or rule out pericarditis quickly.

Gallbladder problems can also mimic supine stomach pain, particularly after fatty meals. When you lie on your right side, a distended or inflamed gallbladder can press against surrounding structures in ways that don’t happen when you’re upright. Kidney stones occasionally produce pain patterns that overlap with stomach pain, especially when a stone is in the upper ureter and the pain radiates forward into the flank or upper abdomen.

Rare and Congenital Possibilities

In a small number of cases, particularly in children or young adults whose pain has been difficult to diagnose, congenital anatomical variants can be at play. Midgut malrotation, a condition where the intestines didn’t rotate into their normal position during fetal development, can cause intermittent or chronic abdominal pain that changes with posture.9PubMed Central. Midgut malrotation with chronic abdominal pain The pain may come and go unpredictably, and because imaging in the standard positions doesn’t always catch the problem, it can go undiagnosed for years.

These cases are genuinely rare and not something to worry about unless you’ve had persistent, unexplained abdominal pain since childhood that hasn’t responded to typical treatments. If that description fits, a specialized imaging study or consultation with a pediatric or surgical gastroenterologist may be worthwhile.

Sleep Position Strategies That Actually Help

If reflux is the main issue, the position you sleep in matters more than most people realize. A systematic review and meta-analysis found that sleeping on the left side was associated with significantly less acid exposure in the esophagus compared to sleeping on the right side or supine.10PubMed Central. Left lateral decubitus sleeping position is associated with improved gastroesophageal reflux disease symptoms: A systematic review and meta-analysis This is thought to work because of anatomy: when you lie on your left side, the stomach hangs below the esophageal junction, making it harder for acid to flow uphill into the esophagus. When you lie on your right side, the stomach sits above the junction, turning gravity into an accomplice.

The same meta-analysis noted that a randomized trial using electronic sleep positional therapy, a device that nudges sleepers toward their left side, showed improvement in nighttime reflux symptoms including more reflux-free nights. You don’t need a device to try this: a body pillow behind your back can discourage rolling onto your right side. Elevating the head of the bed by about six inches, using a wedge pillow or bed risers rather than just stacking regular pillows, also reduces acid contact time by keeping the esophagus above the stomach even when you’re on your back.

For gas-related supine pain, the strategies are slightly different. Gentle movement before bed, like a short walk after dinner, helps clear gas before you lie down. Avoiding carbonated drinks and large meals within two to three hours of bedtime reduces the volume of gas your colon has to deal with once you’re horizontal. Some people find that lying on their left side also helps with gas, though the evidence here is less robust than it is for reflux.

Sorting Out What’s Causing Your Pain

Because so many different conditions can cause supine stomach pain, paying attention to the character and timing of your pain helps narrow things down considerably. A few distinguishing features are worth noting:

  • Burning behind the breastbone: Most likely acid reflux, especially if it starts within an hour of lying down and improves when you sit up or take an antacid.
  • Pressure or bloating: Trapped gas or functional bloating, especially if it worsens after meals high in fiber, beans, or dairy and improves with position changes or passing gas.
  • Sharp, localized spot: Consider abdominal wall nerve entrapment (ACNES), especially if pressing on the spot while tensing your abs reproduces the pain exactly.
  • Sharp and relieved by leaning forward: Think pericarditis or another cardiac cause, particularly if accompanied by fever or recent illness.
  • New pain after starting a medication: Pill esophagitis is possible if you’ve been taking tablets at bedtime without enough water.

Keep in mind that these patterns overlap, and more than one cause can coexist. Someone with reflux may also have functional dyspepsia layered on top, making the pain harder to interpret. If your pain is severe, wakes you from sleep regularly, or is accompanied by weight loss, vomiting blood, or black stools, those are signals to get evaluated promptly rather than experimenting with position changes at home.

Why the Timing Fools People

One of the frustrating things about positional stomach pain is that it can be hard to take seriously, both for the person experiencing it and sometimes for clinicians. Pain that vanishes the moment you sit up can seem trivial, as if lying down just makes you notice something mild that was always there. But the mechanisms described above are real physiological changes: acid exposure genuinely increases, gas genuinely gets trapped, nerve compression genuinely intensifies. The pain isn’t psychological, and the positional trigger is a diagnostic clue, not a reason to dismiss it.

In fact, the positional nature of the pain is one of the most useful pieces of information you can bring to a medical visit. “It only hurts when I lie down” is not a vague complaint. It immediately points your doctor toward a specific set of causes and away from others. If the pain is also one-sided, or if it changes depending on which side you lie on, that narrows things further. Keeping a brief log of when the pain starts relative to lying down, what position makes it better or worse, and what you ate or took before bed gives your doctor a surprisingly clear roadmap for figuring out what’s going on.