You can’t eliminate sleep farting entirely, but you can significantly reduce it by changing what and when you eat, adjusting your sleep position, and addressing any underlying causes of excess gas. Most nighttime gas comes from food still fermenting in your colon while you sleep, combined with the fact that your body’s natural defenses against releasing gas are weaker when you’re unconscious.
Why You Fart More in Your Sleep
During sleep, the pressure in your anal canal drops compared to when you’re awake. Your colon also loses some of its muscle tone and contracts less frequently. The result: gas that your body might hold back or release more discreetly during waking hours escapes more freely at night. Your rectum actually becomes more active during sleep even as the muscles keeping things sealed relax, creating a perfect setup for involuntary gas release.
The gas itself is mostly produced hours before it escapes. When you eat foods that are difficult to digest, bacteria in your large intestine ferment them and produce hydrogen, methane, and other gases. That process peaks several hours after a meal, which means dinner and late-night snacks tend to produce gas right around the time you’re deep asleep.
Foods That Make It Worse
The biggest culprits are FODMAPs, a group of short-chain carbohydrates that your small intestine absorbs poorly. Instead of being digested normally, they travel to your colon where bacteria feast on them and produce gas. Common high-FODMAP foods include beans, lentils, cabbage, broccoli, onions, garlic, wheat, and certain fruits like apples and pears. Dairy products cause the same problem if you’re lactose intolerant.
Carbonated drinks are another straightforward source. Every sip delivers dissolved gas directly into your digestive tract. Chewing gum causes you to swallow extra air, which has to exit one way or another. If you’re taking prebiotic or probiotic supplements, those can also increase gas production. They work by feeding or adding gut bacteria, and more bacterial activity means more fermentation and more gas as a byproduct.
You don’t necessarily need to eliminate these foods permanently. The key is timing. Eating a bean-heavy dinner at 8 p.m. will produce peak gas around midnight. Shifting your highest-FODMAP meals to lunch gives your body more waking hours to process and pass that gas before bed.
How Swallowed Air Adds Up
Not all nighttime gas comes from digestion. Aerophagia, or air swallowing, is a surprisingly common contributor. If you eat quickly, talk while eating, drink through straws, or breathe through your mouth during sleep, you’re sending extra air into your stomach. Some of it gets burped out, but whatever passes into your intestines eventually comes out the other end.
If you use a CPAP machine for sleep apnea, this is worth paying attention to. Pressurized air from the machine can leak into your stomach, especially during swallowing. In one study, flatulence was the most bothersome gastrointestinal symptom reported by CPAP users, and it increased significantly after starting therapy. Adjusting your CPAP pressure settings or switching to a different mask style can help reduce air swallowing. Talk to your sleep specialist if you’ve noticed more gas since starting CPAP.
Eat Earlier and Eat Slower
The single most effective change is putting more time between your last meal and bedtime. Aim for at least three hours. This gives your digestive system time to move food through the small intestine and begin processing it while you’re still upright and awake. A lighter dinner also helps. Large, heavy meals take longer to digest and produce more gas overall.
Eating slowly and chewing thoroughly reduces the amount of air you swallow and gives digestive enzymes more time to break down food in your mouth and stomach before it reaches the colon. Avoid eating while distracted, since people tend to eat faster and swallow more air when watching screens or rushing through meals.
Try Sleeping on Your Left Side
Your sleep position affects how gas and digestive contents move through your system. Sleeping on your left side positions your stomach below your esophagus, which reduces acid reflux and helps your stomach empty more efficiently. Research on sleep positioning shows that left-side sleeping significantly reduces reflux episodes compared to both right-side and back sleeping. While the studies focused on acid reflux, the same gravitational advantage applies to gas movement: your digestive tract can process and move contents more smoothly when you’re on your left side.
Sleeping on your back tends to pool gas in your intestines with fewer easy escape routes during the normal digestive process. If you’re a back sleeper and nighttime gas is a real problem, experimenting with a body pillow to keep yourself on your left side is a low-effort change worth trying.
Over-the-Counter Options
If dietary changes alone aren’t enough, a digestive enzyme called alpha-galactosidase (sold as Beano and similar products) can help. It works by breaking down the specific complex sugars in beans, vegetables, and grains before they reach your colon, preventing bacteria from fermenting them into gas in the first place. In a randomized, placebo-controlled trial, alpha-galactosidase significantly reduced both bloating and the proportion of people experiencing flatulence compared to placebo. You take it at the beginning of a meal, not after, so it can work alongside your food as it’s digested.
Simethicone (the active ingredient in Gas-X) works differently. It breaks up gas bubbles already in your digestive tract, making them easier to pass. However, the clinical evidence for simethicone actually reducing total gas production is weak. It may help with the uncomfortable bloated feeling but won’t necessarily reduce how much gas your body produces overnight. Activated charcoal supplements fall into the same category: sometimes recommended, but without strong evidence behind them.
When Excess Gas Signals Something More
Everyone passes gas, and the range of normal is enormous. Recent research using wearable gas-sensing devices found that people average around 32 episodes per day, with individual totals ranging from 4 to 59. So “excessive” is hard to define. The better question is whether your gas comes with other symptoms.
If nighttime gas is paired with persistent bloating, abdominal pain, diarrhea, or constipation, it could point to irritable bowel syndrome or a condition called small intestinal bacterial overgrowth (SIBO), where bacteria that normally live in your large intestine colonize the small intestine and start fermenting food much earlier in the digestive process. SIBO is more common in people who take acid-reducing medications like proton pump inhibitors, and it tends to cause particularly noticeable bloating and flatulence. Both IBS and SIBO are treatable, and identifying them often starts with a simple breath test.
Lactose intolerance and celiac disease can also produce significant gas that worsens at night after dinner. If you’ve tried the dietary and timing adjustments above for a few weeks without improvement, the gas may be a symptom rather than the problem itself.

