Created for Greatist by the experts at Healthline. Read more

When you have an upset stomach, you probably don’t think “Hmm… I wonder how my sleeping position is affecting my digestion?” Instead, you probably think “Ow. Why does my stomach feel all stabby?”

Though sleep and digestion may seem like completely separate things, they’re related in a number of ways. How you sleep at night can aid your digestive system, or hinder it.

At the moment, there isn’t a great deal of scientific evidence on the effect of sleeping positions on gut health. But there’s growing information on how sleep can improve (or worsen) digestion and some promising ideas about ways to sleep to get a quality snooze and a happy tummy.

If digestive problems were solely a matter of the stomach, fixing gut health would be easy. But the digestive system is incredibly complex and solutions to bloating, pain, gas, constipation, and diarrhea can be pretty complicated.

Though tummy trouble can come from direct food sources, some of the other triggers are more mysterious.

Scientists have found a strong connection between the gut and the brain through what’s called the enteric nervous system (ENS). The ENS is thin layers of nerve cells that encompass your entire digestive tract from mouth hole to b-hole (to use scientific terms).

The ENS controls the whole process of digestion, which means it’s in constant communication with our brain to control a major percentage of our body.

Some evidence shows that bowel troubles can trigger emotional responses and that IBS and other digestive disorders may cause depression and anxiety.

What’s this have to do with sleep? Well, it shows that the world of our bowels is complicated.

Though there isn’t a study that says “sleeping on your back will definitely prevent stomach problems,” there’s some evidence to show that sleeping positions can affect your mental, physical, and digestive health.

So, if there’s a way to make your digestive health a little better (and it exclusively involves laying down in bed), why not give it a try?

On your left side

When Falcon said “on your left” to Captain America in “Endgame,” he probably wasn’t referring to the best way for Cap to reduce bloating, but he was still correct.

Sleeping on your left side lets gravity do some of the digesting work for you, which can reduce stomach problems.

When you’re feeling bloated or gassy, often it’s simply a matter of having too much poop in your system (again, sorry to use all these scientific terms).

Gas and bloating is a natural side effect of digesting food. But when that food moves through your system too slowly, the gas doesn’t have a place to go and you wind up feeling bloated.

By helping food and waste move through your system, you’ll have more regular bowel movements and less gas and bloating.

Sleeping on your left side lets gravity help waste get from the small intestine to the large intestine. The ileocecal valve separates the small and large intestines and sits on the lower right side of the body.

By giving the ileocecal valve some room to move, waste can travel more freely and potentially reduce a number of digestive difficulties.

Getting into this position is simple: Get in bed. Lay on your left side. Keep laying there. Of course, sleeping in a new position doesn’t always come easily. It can take a few nights before you get used to something new, so be patient.

You can switch to your right side if your left shoulder starts to hurt, but try to start your slumber on the left and stay as long as you’re comfortable. Even if you wake up in a different position, getting some time on the left will help your digestive tract to keep moving along.

On your side with a pillow between your legs

Sleeping on your left side might be the best way to keep your small and large intestines at ease, but if it’s uncomfortable, that’s a problem too.

Some digestive disorders (like Crohn’s and colitis) are caused by inflammation. Sometimes, this inflammation is directly caused by something you ate, but it can also be triggered by a lack of sleep.

When you’re sleep deprived, the body secretes inflammatory cytokines, which then make you more inflamed and less likely to sleep. What a circle of fun.

If sleeping on your left side causes pain or disrupts your sleep, that could cause poor digestion. One way to sleep peacefully and ease your troubled stomach is to sleep on your side with a pillow between your legs. Pick whichever side feels more comfortable.

The pillow between your legs allows your spine to stay aligned. Instead of your hips and lower back getting pulled out of line, the pillow gives just enough height to keep your lower half in comfortable alignment.

You might also feel relief on your knees, since the weight no longer rests on the joint.

To get into this position, lay on the side that’s most comfortable. Then, put a regular-sized pillow right between your knees. You should feel a bit of relaxation in the hips and lower back.

If your spine still feels like it’s out of alignment, try a larger or smaller pillow until you feel most comfortable.

On your back

Sleeping supine, or on your back as most normal people would say, is one of the best sleeping positions for pain. Though side sleeping is most popular for adults, it can cause shoulder or hip pain.

When you sleep on your back, your weight is evenly distributed, giving your shoulders and hips a break.

Overall, sleeping on your back has the most benefits to your health. Your spine naturally stays aligned, so your muscles are more relaxed. Relaxation means less inflammation, which can lead to less discomfort.

Plus, the digestive system isn’t twisted up in knots, it’s lying peacefully aligned on your mattress, ready to move that food through the intestines.

If you aren’t used to laying on your back, it may not feel comfortable at first. Try a quick meditation as you go to sleep to help your muscles relax and adjust to the new position.

On your back with a pillow under your knees

When all of your back is evenly supported by your mattress, it should feel pretty good.

Unfortunately, not all mattresses are created equal and sometimes the curve of your lower back can go unsupported, even in a simple supine position.

If you lay on your bed and feel your lower back curving up from the mattress, that means you aren’t getting proper lumbar support. To fix this, put a pillow under your knees.

By raising the legs slightly, you flatten the curve in your lower back. This puts less strain on your back and should make supine sleeping much more comfortable. With the lumbar region supported, you get all the benefits of back sleeping, including a happier tummy.

To get in this position lay down on your back. Then, put a pillow either directly under the knees or under the knees and thighs. Lay down again and make sure that all of your back lays flat against the mattress.

You may have to experiment with exact placement and height of pillows to get the support you need.

Thus far, we’ve really sung the praises of sleeping on your back. But there’s one digestive problem that can make back sleeping a real issue — acid reflux.

Being flat on your back during a reflux attack is very unpleasant. The supine position itself makes matters worse, as the position allows the acid to travel up the throat fairly easily.

Also, if you have any sinus or snoring conditions, straight-up back sleeping can do more harm than good. Luckily, a simple adjustment can make all the difference — add pillows! In other words, elevate your head.

By lifting the head, acid reflux now has to work against gravity to annoy you, which tends to minimize reflux effects. Also, the raised head position helps clear sinuses and reduces snoring.

To find the right amount of elevation for you, start with an extra pillow. If you have extreme acid reflux, GERD, or sleep apnea, you may want to try a padded wedge. The triangular-shaped pillow gives greater support to your head, neck, and ribcage.

This isn’t shocking news, but it’s best to not sleep on your stomach when you’re having stomach problems. First of all, sleeping on your stomach puts all of your weight on the place that’s in the most pain, not a great move.

Secondly, it’s very hard to get good spine alignment when you sleep on your stomach, as you’re automatically putting strain on your hips and back. That stress and strain can lead to greater inflammation and prolonged toilet troubles.

If you have GERD, reflux, or extreme nausea, avoid sleeping flat on your back. Laying flat makes it easier for the acid to travel and you want all that acid to stay right in the stomach, where it belongs.

For constipation, sleeping on your side with your knees tucked (fetal position) may feel comfortable but may not have any great effects on relieving the constipation. It won’t do any harm, but be sure that your knees aren’t pulled in too close to the chest. You want the position to be as relaxed as possible.

If you have diarrhea, sleep in whatever position allows you to get out of bed the fastest.

There’s not much a sleeping position can do to help diarrhea, so it’s best to stick with what feels comfortable and lets you run to the bathroom when the time comes. (Don’t forget to hydrate!)

Getting a good night’s sleep impacts every facet of health, including gut health. Without sleep, the body produces more inflammatory hormones, craves sugar and “fast” food, and generally runs at a reduced capacity.

All of these things greatly harm the digestive system. Inflammation causes pain and bloating, while sugar feeds bacteria and also encourages inflammation.

When general energy runs low, that means digestion slows down, causing increased chances of gas, bloating, and constipation.

Basically, sleep makes everything better and lack of sleep makes everything worse. Even if sleep isn’t the primary cause of your digestive troubles, getting more sleep will only help you heal faster.

tl;dr

Though there isn’t a lot of science behind sleep positions and digestive health, there’s a definite connection between certain sleep positions and better rest. If you can, sleep on your left side or on your back for the greatest health benefits and avoid sleeping on your stomach when digestive troubles come your way.