Why Does My Stomach Hurt Before Bed and How to Help

Stomach pain that shows up in the evening or right before bed is common, and it usually comes down to one of a few causes: acid reflux worsening as you lie down, eating too late or too much at dinner, or an underlying condition like an ulcer or irritable bowel syndrome. Your body’s own chemistry plays a role too. Gastric acid production naturally peaks in the late evening and early morning hours, which means your stomach is at its most acidic right around the time you’re trying to sleep.

Acid Reflux Gets Worse at Night

The most common explanation for pre-bedtime stomach pain is gastroesophageal reflux, or GERD. A ring of muscle at the bottom of your esophagus is supposed to act like a one-way valve, keeping stomach acid where it belongs. When that muscle relaxes at the wrong time, acid flows back up into your esophagus, causing a burning sensation in the chest or upper abdomen.

Gravity works in your favor during the day. When you’re upright, acid naturally stays in the stomach. The moment you recline on the couch or get into bed, that advantage disappears. Acid can pool against the weakened valve and leak upward more easily. Nighttime reflux can also trigger a chronic cough, hoarseness, or worsening asthma symptoms that you might not immediately connect to your stomach.

What You Ate (and When) Matters

Certain foods relax that esophageal valve and slow digestion, leaving food sitting in your stomach longer than usual. The biggest offenders are foods high in fat, salt, or spice: fried food, pizza, fast food, fatty meats like bacon and sausage, and cheese. Tomato-based sauces, citrus fruits, chocolate, peppermint, and carbonated drinks can trigger the same problem. Even milk, often thought of as soothing, contains fat that can aggravate acid reflux.

Timing is just as important as the food itself. Eating a large or heavy meal close to bedtime means your stomach is still actively digesting when you lie down. Finishing dinner at least two to three hours before sleep gives your stomach enough time to move food along, reducing the chance that acid and partially digested food will back up into your esophagus.

Ulcers Flare on an Empty Stomach

If your pain feels like a gnawing or burning sensation between your breastbone and navel, and it tends to get worse between meals or late at night, a peptic ulcer could be the cause. Ulcers form when stomach acid eats through the protective mucus lining of your stomach or small intestine, creating an open sore. This happens either because acid production increases or because the mucus layer thins out, often due to a bacterial infection or long-term use of certain pain relievers.

The reason ulcer pain flares before bed is straightforward: your stomach is likely empty or nearly empty by then. Without food to absorb and buffer the acid, it contacts the raw, exposed sore directly. People with ulcers often notice that eating a small amount temporarily relieves the pain, only for it to return once the stomach empties again. If you’re experiencing this pattern regularly, it’s worth getting checked, since ulcers are very treatable once diagnosed.

Slow Stomach Emptying

Gastroparesis is a condition where the stomach takes significantly longer than normal to move food into the small intestine. It’s not that the stomach is paralyzed. Rather, the muscles and nerves controlling digestion don’t coordinate properly. The result is bloating, a feeling of fullness long after eating, upper abdominal pain, and nausea, all of which tend to peak after your evening meal since that’s typically the largest meal of the day.

In a healthy stomach, at least 50% of a meal empties within two hours. With gastroparesis, less than 40% may empty in that same window. Food lingers, the stomach stretches, and the discomfort builds as bedtime approaches. If you consistently feel uncomfortably full or bloated hours after dinner, gastroparesis is one possible explanation your doctor can test for with a gastric emptying study.

IBS and Nighttime Discomfort

Irritable bowel syndrome causes recurrent abdominal pain tied to changes in bowel habits. While IBS itself doesn’t typically wake people from sleep, it can make falling asleep difficult. Abdominal pain activates your body’s stress response, which raises alertness and reduces sleep quality. A meta-analysis of 36 studies covering more than 63,000 people found that about 37.6% of IBS patients had a sleep disorder, and people with IBS were roughly 2.6 times more likely to have sleep problems than healthy controls.

The connection runs both directions. Poor sleep can worsen IBS symptoms the next day, creating a frustrating cycle where pain disrupts sleep and poor sleep amplifies pain. If your bedtime stomach pain comes with bloating, cramping, diarrhea, or constipation that’s been going on for months, IBS is a likely possibility.

Your Body’s Acid Clock

Even without any underlying condition, your stomach naturally produces more acid in the late evening and early morning as part of your circadian rhythm. This means stomach pH drops to its lowest point right around bedtime. For most people, this goes unnoticed. But if you already have mild reflux, a sensitive stomach lining, or you’ve eaten a triggering food, that natural acid surge can push mild discomfort into noticeable pain.

Practical Ways to Reduce the Pain

The simplest change is creating a buffer between your last meal and bedtime. Two to three hours is the general target. If you need a late snack, keep it small and low in fat. Avoiding the common trigger foods listed above, especially in the evening, can make a significant difference within days.

Sleep position also plays a role. Sleeping on your left side keeps your stomach positioned below the esophageal opening, making it harder for acid to flow upward. When you sleep on your right side, the anatomy flips: the stomach sits above the esophagus, and acid flows toward the valve more easily. Studies consistently show that right-side sleeping causes more reflux episodes and longer acid exposure than left-side sleeping. Elevating the head of your bed by a few inches (using a wedge pillow or bed risers, not just extra pillows) can add another layer of protection by keeping gravity on your side.

Loose-fitting sleepwear helps too. Tight waistbands put pressure on your abdomen and can push stomach contents upward. Reducing portion sizes at dinner, eating slowly, and avoiding carbonated drinks in the evening are all small adjustments that address the most common triggers.

Signs That Need Medical Attention

Most bedtime stomach pain is manageable with lifestyle changes, but certain symptoms signal something more serious. Seek medical care if you experience severe pain that doesn’t respond to over-the-counter antacids, vomiting (especially if there’s blood), blood in your stool, unexplained weight loss, fever, abdominal swelling or tenderness to touch, difficulty breathing, or yellowing of your skin and eyes. Ongoing pain that wakes you from sleep repeatedly also warrants evaluation, since that pattern is more suggestive of ulcers or other structural problems than simple indigestion.