Yes, you can fart in your sleep. Your digestive tract keeps moving, intestinal bacteria produce gas, and the muscles that control the anus do not form an unchanging seal all night. Passing gas once in a while without pain, marked bloating, or a change in bowel habits is usually just normal physiology 1 2.
The sleep-specific evidence is limited, however. Researchers have measured gut movement and anal pressure during sleep, but those studies did not count how often people passed gas. There is no well-established number of nighttime episodes that is considered normal.
Why gas can pass while you sleep
Digestive gas comes mainly from two sources:
- Swallowed air. Everyone swallows some air while eating and drinking. Air that is not released by belching can move through the intestines and leave through the anus.
- Fermentation in the colon. Bacteria in the large intestine break down carbohydrates that were not fully digested earlier in the gut. Gas is one of the byproducts 1.
Gas swallowed or produced earlier can still be in the digestive tract at bedtime, while fermentation and gastrointestinal movement continue. In a small pilot study of nine healthy adults, gastrointestinal movement continued during sleep, although colonic activity was lower during sleep than during nighttime wakefulness. The study tracked movement through the digestive tract and did not measure flatulence itself 3.
A separate overnight study of eight healthy men found that anal resting pressure varied and had a prominent decrease during the period when participants slept. This finding makes the passage of gas during sleep physiologically plausible, but the study was small, included only men, and did not establish how often it happens 2.
It is therefore too simple to say that people fart because “all the muscles relax” in a particular sleep stage. Sleep changes digestive and sphincter activity, but research does not support a dependable stage-by-stage rule for flatulence.
Why it may seem worse at night
Noticing gas at night does not necessarily mean sleep is creating more gas. Food eaten earlier can still be moving through the digestive tract, and fermentation does not follow a precise bedtime schedule. A partner may also notice a sound or odor that the sleeping person does not.
Several daytime factors can affect what happens later:
- eating or drinking quickly
- chewing gum or sucking hard candy
- drinking carbonated beverages
- eating carbohydrates that trigger symptoms for you
- having constipation or another digestive condition
Odor is not a measure of how much gas you produced, and it is not evidence that your body is “detoxing.” Some intestinal gas contains sulfur compounds, which can account for an unpleasant smell 1.
There is also no strong evidence that one sleep position reliably prevents nighttime flatulence. A position may feel more comfortable when you are bloated, but back, side, and stomach sleeping have not been shown to predictably control gas production or passage.
CPAP and swallowed air
If gas began or became more troublesome after starting CPAP, APAP, or bilevel PAP, tell the clinician or sleep team managing the treatment. Pressurized air can sometimes enter the stomach and intestines, a problem often called PAP-related aerophagia. Symptoms may include belching, bloating, abdominal discomfort, and flatulence.
A retrospective sleep-clinic study of 753 adults found that PAP-related aerophagia was associated with higher treatment pressure and gastroesophageal reflux disease. Because this was an observational study using newly developed diagnostic criteria, it cannot show that pressure or reflux caused the symptoms in every patient 4.
Do not stop PAP or lower a prescribed pressure on your own because of gas. The treatment team can look at when the symptoms started, the device data, pressure needs, mask fit and leak, and other possible digestive causes before deciding whether any adjustment is appropriate.
Food can matter, but avoid a blanket restriction
Fiber, starches, lactose, fructose, and sugar alcohols can reach the large intestine and be fermented. Foods that contain them are not automatically unhealthy, and the same food does not trigger symptoms in everyone 1.
If nighttime gas is bothersome, use your own pattern rather than a generic “foods to avoid” list:
- For one or two weeks, note what you ate, meal size and timing, bowel movements, PAP use if relevant, and symptoms.
- Look for a repeated link, such as symptoms after fizzy drinks, a specific dairy food, large portions of legumes, or products containing sweeteners that end in “-ol.”
- Change one likely trigger at a time. This makes it easier to see whether the change helped.
Eating more slowly, skipping gum or hard candy, and reducing fizzy drinks can reduce swallowed air. Smaller meals may help some people, but there is no universal rule that everyone must finish dinner a fixed number of hours before bed 5.
A low-FODMAP diet is not a first response to harmless sleep flatulence. For people with irritable bowel syndrome, expert guidance describes it as a structured three-phase approach: short-term restriction, reintroduction, and personalization. It is not intended to become a permanent broad elimination diet 6.
Probiotics are not a predictable cure for nighttime gas either. A systematic review of 82 randomized trials in adults with irritable bowel syndrome found that effects differed by product and strain. Evidence for improvement in bloating or distension was of very low certainty 7. Ask a clinician or dietitian before spending money on supplements or removing major food groups, especially if symptoms are persistent 6.
Constipation and digestive conditions
Constipation can make gas and bloating more uncomfortable. If constipation is part of the pattern, address it rather than focusing only on the gas. Fiber and fluids can help. Add fiber gradually so your body can adjust, stay adequately hydrated, and seek advice if constipation persists 8.
Gas with repeated pain, diarrhea, constipation, or weight loss can also occur with conditions such as irritable bowel syndrome, lactose or fructose intolerance, celiac disease, small intestinal bacterial overgrowth, and disorders that slow or block intestinal movement. Irritable bowel syndrome can alter how gas moves and how strongly a person feels bloating or pain, so severe discomfort does not always mean an unusually large amount of gas 1.
One symptom alone cannot identify any of these conditions. For example, gas after dairy is not enough to diagnose lactose intolerance, and nighttime gas is not enough to diagnose SIBO. A clinician can decide whether the full symptom pattern warrants testing.
A practical plan for bothersome nighttime gas
If the only issue is occasional gas while asleep and you otherwise feel well, no treatment may be necessary. If it is uncomfortable or repeatedly interrupts sleep, try the lowest-risk steps first:
- Keep a brief food, bowel, symptom, and PAP log.
- Eat and drink more slowly if you tend to rush.
- Reduce gum, hard candy, fizzy drinks, and drinking through a straw if swallowed air seems likely.
- Test one suspected food or portion-size trigger at a time instead of cutting out several food groups.
- Address constipation gradually.
- Choose a sleep position for comfort, not as a promised anti-gas treatment.
- Ask your PAP team about new bloating, belching, or flatulence after starting or changing treatment.
Medicines and supplements should match the likely cause. Lactase, for example, is intended for lactose intolerance rather than gas from every source. Talk with a healthcare professional before using probiotics or repeatedly relying on over-the-counter products 5.
When to talk with a doctor
Arrange a medical evaluation if gas is persistent, suddenly different, or bothersome enough to affect sleep or daily life. It is more important to seek advice when gas comes with:
- recurring abdominal pain or visible distension
- persistent constipation or diarrhea
- unintentional weight loss
- new symptoms after a medication or PAP change
Seek prompt medical help for severe or unrelenting abdominal pain, repeated vomiting, or a progressively swollen abdomen. An inability to pass stool or gas along with pain, bloating, nausea, or vomiting can occur with an intestinal obstruction or pseudo-obstruction and needs urgent assessment 9.
Blood in vomit or stool and black, tarry stool also require medical help. Dizziness, fainting, confusion, shortness of breath, or a fast heart rate with signs of gastrointestinal bleeding can indicate a severe bleed and warrants emergency care 10.
The bottom line
Passing gas during sleep is possible because gas production and movement do not stop overnight. An occasional episode on its own is usually normal. Sleep research supports a plausible mechanism, but it does not establish a special sleep-stage trigger or a nightly target number.
If nighttime gas is uncomfortable, look for a repeatable pattern involving swallowed air, food, constipation, or PAP use, then make one focused change at a time. Pain, marked swelling, vomiting, bleeding, weight loss, or an inability to pass stool or gas changes the situation and should prompt medical care.





