Gas in the stomach is primarily caused by swallowing air when eating or drinking, and most stomach gas is released when burping. Gas forms in the large intestine when bacteria ferment carbohydrates that aren't digested in the small intestine. Certain foods and drinks that contain types of carbohydrates, such as sugars, starches, and fiber, can also cause gas. Excess gas can be a symptom of chronic intestinal conditions, such as diverticulitis, ulcerative colitis, or Crohn's disease. Other factors that can cause gas include constipation, food intolerances, and digestive disorders