Coffee can cause diarrhea in some people due to the stimulant effects of caffeine on the gastrointestinal system. Caffeine increases gastric acid secretion and accelerates intestinal motility, which can result in loose stools or diarrhea, especially in those with IBS. Limiting coffee intake may help.