Medically reviewed by
Dacelin St Martin, MD
Triple board-certified in Sleep Medicine,
Internal Medicine, and Pediatrics.
Where Does Gas Come From? | Why Do We Pass Gass at Night? | What Causes Abnormal Nighttime Flatulence? | How Do I Prevent or Reduce Nighttime Flatulence? |
What Causes Gas Pains? | What’s the Takeaway?
The average healthy person passes gas about 13 to 21 times a day. While this may embarrass you or your partner, it’s a normal bodily function. You could also unconsciously pass gas at night.
Flatulence, also known as farting, passing gas, or breaking wind, is not just a normal physiologic event; it’s healthy for you. Flatulence helps you to let go of trapped air that would otherwise cause abdominal pain.
However, you may pass so much gas at night that it prevents you from falling asleep, interrupts your sleep, or affects your relationship.
Where Does Gas Come From?
There are three main ways gas gets trapped in your digestive tract:
- When you swallow air while talking or eating
- Neutralization of stomach acid (bicarbonates)
- Gas produced by gut microbiota
Gut microbiota is the microorganisms living in the digestive tract. They help to break down food and digest certain substances. They contribute to a healthy gut and a balanced bowel. On the flip side, they produce gasses like hydrogen, methane, and even sulfur, giving gas its distinctive (and unfriendly) smell.
The gas accumulated in the gut has only two ways out; through the mouth as a burp or the anus as flatulence. The anal sphincter is a muscle that controls the passage of materials through the anus. It also prevents you from passing gas spontaneously.
Why Do We Pass Gas at Night?
The anal sphincter typically squeezes the anus shut such that neither gas nor stool escapes without your knowing. However, the anal sphincter loses muscle tone at night, meaning that small amounts of gas can escape without you knowing.
You are also more likely to pass gas at night or in the wee hours of the morning because of the position of the colon during sleep. Sleeping on one side may make gas accumulation and release easier as pressure increases.
Anybody can pass gas while they’re sleeping. The amount of gas you pass depends on your lifestyle choices, diet, and other coexisting conditions.
What Causes Abnormal Nighttime Flatulence?
It’s relatively uncommon to find that flatulence disturbs sleep. You may never realize you pass gas in your sleep unless your roommate or partner informs you. Nonetheless, there are cases where changes in diet or the presence of an illness can cause disturbing bowel changes.
In such cases, the stench or sound of passing gas can jolt you from sleep. If accompanied by gas pains, it may be difficult to sleep. Abnormal nighttime flatulence can be caused by food, lifestyle, medications, disease, or physiological conditions such as periods and pregnancy. Keep reading to find out about 5 common causes of gas.
1) Diet and Flatulence
Certain foods are flatulogenic, meaning that they make you more likely to produce gas. Some people experience more flatulence with a particular food, while others do not. Nonetheless, avoiding these food options close to bedtime can reduce the occurrence of nighttime flatulence.
- Carbonated drinks
- Foods with artificial sweeteners like sorbitol, aspartame, etc
- Bread and pastries
- Legumes, e.g., beans and peas
- Vegetables like cabbage, cauliflower, broccoli, onion, and garlic
2) Lifestyle and Flatulence
Specific inclusions to your lifestyle may affect how often you pass gas. Some examples are:
- Chewing lots of gum, especially those with artificial sweeteners
- Having a late dinner
- Lying down soon after eating
- Eating fast
3) Medications and Flatulence
Serious flatulence problems resulting from drug use are few and far between. Drugs may also increase the gas tension in your abdomen. Also, ceasing the medication should immediately relieve you of excessive flatulence. Examples are:
- Antibiotics e.g, Gentamicin
- NSAIDs (Non-Steroidal Anti-Inflammatory Drugs) like Ibuprofen and Piroxicam
- Antifungal medications
- Some laxatives
- Statins e.g., Atorvastatin
4) Diseases and Flatulence
Most digestive diseases present with some degree of flatulence, such as:
- Irritable Bowel Syndrome (IBS): IBS is a lifelong condition characterized by bloating, diarrhea, constipation, and excessive flatulence. IBS can be adequately managed by learning and avoiding triggers, using medications, and managing its symptoms.
- Small Intestinal Bacterial Overgrowth (SIBO): In SIBO, excessive flatulence is caused by an imbalance in the number of gut bacteria. Antibiotics can correct it.
- Ulcerative Colitis: This condition involves inflammation and eventual ulceration of the colon and rectum, increasing hydrogen sulfide release and hence flatulence.
- Crohn’s Disease: Crohn’s disease affects the small intestine, making digestion incomplete. This condition leaves more work for gut microbiota, releasing more gas.
Nighttime flatulence may also result from undergoing treatment for a sleep problem. Aerophagia, which means swallowing air, is a common side effect of CPAP (Continuous Positive Airway Pressure) treatment for Obstructive Sleep Apnea.
Using a CPAP machine may cause you to swallow air during your sleep. The trapped air leads to excessive belching and flatulence. You can manage aerophagia secondary to CPAP use by changing your mask, sleeping position, or asking your doctor what other solutions you may try. CPAP-induced aerophagia may also cause gastroesophageal reflux.
How Do I Prevent or Reduce Nighttime Flatulence?
Reducing nighttime flatulence generally involves identifying the cause or trigger and avoiding them. These tips can help your sleep flatulence.
- Wait 2 hours after eating before lying down
- Avoid carbonated foods, chewing gum, etc
- Exercise often for better digestion
- Eat slowly and chew properly
- Avoid drastic increases in fiber intake
What Causes Gas Pains?
Gas obstructions in your gut can be painful and cause discomfort. Gas pains occur when you can’t release trapped gas by flatulence or belching. Gas pains may sometimes feel like chest pain or appendicitis, depending on the location of the blockage.
In many cases, gas pains are associated with constipation, because feces are unable to pass due to an intestinal gas blockage.
What’s the Takeaway?
Flatulence is normal, and you may pass gas at any time of the day, including during your sleep. However, excessive nighttime flatulence can interrupt sleep and affect your relationship. You can stop passing gas while you sleep by avoiding foods like legumes, carbonated drinks, artificial sweeteners, and pastries at least two hours before bedtime.
- Pimentel, M., Mathur, R., & Chang, C. (2013). Gas and the microbiome. Current gastroenterology reports, 15(12), 356. https://doi.org/10.1007/s11894-013-0356-y
- Enck, P., Eggers, E., Koletzko, S., & Erckenbrecht, J. F. (1991). Spontaneous variation of anal “resting” pressure in healthy humans. The American journal of physiology, 261(5 Pt 1), G823–G826. https://doi.org/10.1152/ajpgi.1991.261.5.G823
- Manichanh, C., Eck, A., Varela, E., Roca, J., Clemente, J. C., González, A., Knights, D., Knight, R., Estrella, S., Hernandez, C., Guyonnet, D., Accarino, A., Santos, J., Malagelada, J. R., Guarner, F., & Azpiroz, F. (2014). Anal gas evacuation and colonic microbiota in patients with flatulence: effect of diet. Gut, 63(3), 401–408. https://doi.org/10.1136/gutjnl-2012-303013
- Chey, W. D., Kurlander, J., & Eswaran, S. (2015). Irritable bowel syndrome: a clinical review. JAMA, 313(9), 949–958. https://doi.org/10.1001/jama.2015.0954
- Shepherd, K., Hillman, D., & Eastwood, P. (2013). Symptoms of aerophagia are common in patients on continuous positive airway pressure therapy and are related to the presence of nighttime gastroesophageal reflux. Journal of clinical sleep medicine: JCSM: official publication of the American Academy of Sleep Medicine, 9(1), 13–17. https://doi.org/10.5664/jcsm.2328