BackgroundClostridioides difficile infection (CDI) is an increasingly common disease in healthcare facilities and community settings. However, there are limited reports of community-onset CDI (CO-CDI) in China. MethodsWe collected diarrheal stool samples from 3885 patients who went to outpatient department or emergency department in a tertiary hospital in China during 2010–2023, analyzed the correlation between patients’ basic information and the detection rate of CDI. Besides, all stool samples from 3885 outpatients included were tested by culturing. Moreover, we randomly selected 89 patients’ stools during the 14 years and isolated 126 C. difficile strains from them. The presence of toxin genes (tcdA, tcdB, cdtA, and cdtB) were confirmed by PCR. Toxigenic strains were typed using multilocus sequence typing (MLST). Susceptibility to 9 antimicrobials was evaluated using the E-test. Results528 of 3885 patients (13.6 %) with diarrhea were finally diagnosed as CDI. The median age of patients included was 51 years (6 months-95 years), while the median of patients with CDI was older than patients with negative results [55.5 years (6 months-93 years) vs. 50 years (9 months −95 years), p < 0.001]. In winter, patients with diarrhea might be more likely to have CDI. The detection rate of CDI of patients in emergency department was much higher than those in other outpatients (20.7 % vs. 12.4 %, p < 0.001), and did differ from each outpatient departments (p < 0.05). There were 95 isolated strains detected as toxigenic C. difficile. Among these strains, 82 (86.3 %) had the tcdA and tcdB genes (A+B+) and 5 of these 82 strains were positive for the binary toxin genes (cdtA and cdtB) (A+B+CDT+). There were 15 different sequence types (STs) by multilocus sequence typing (MLST), while the most ST was ST-54 (23.2 %). ST types composition was relatively stable over the time span of this study. Some strains had high resistance to ciprofloxacin, clindamycin, and erythromycin. Twenty-three isolates (24.2 %) were multidrug-resistant. ConclusionsOutpatients with CDI were common among patients having diarrhea during this period in our hospital. Elderly patients and patients went to emergency department may be susceptible to CDI. Based on MLST, the result revealed that the C. difficile isolates had high genetic diversity and maintained stability in this period. All isolates were susceptible to metronidazole and vancomycin, and nearly one quarter of all isolates had multidrug resistance.