This study employed high-throughput sequencing to explore bacterial diversity and hematological variations across different age groups of giraffes, as well as the impact of diarrhea on their intestinal microbiota. Additionally, the correlation between intestinal flora and hematological indices was examined for the first time. Firmicutes, Bacteroides, and Proteobacteria were the predominant bacterial groups in the giraffe’s intestinal flora. The α-diversity analysis indicated significant variations in microbial diversity among giraffes of varying ages (p < 0.05). Furthermore, giraffes suffering from diarrhea exhibited significant alterations in the abundance of Proteobacteria and Actinobacteriota at the phylum level (p < 0.05). At the genus level, Rikenellaceae_RC9_gut_group, Monoglobus, and Prevotellaceae_UCG-004 had significant differences compared to healthy counterparts (p < 0.05). Hematological parameters such as lymphocyte count (Lym), red blood cell count (RBC), mean corpuscular volume (MCV), mean corpuscular hemoglobin (MCH), mean corpuscular hemoglobin concentration (MCHC), platelet count (PLT), and plateletcrit (PCT) varied significantly across different age groups (p < 0.05). A substantial correlation was observed between the intestinal microbiome composition and hematological parameters (p < 0.05). In conclusion, this study highlights significant differences in both the intestinal microbiome composition and hematological indices among giraffes of different ages. Diarrhea was found to significantly alter the abundance and composition of the intestinal microbial community. These insights provide a valuable theoretical foundation for the microbiological and hematological aspects of giraffe health management and breeding practices.