Information on the gut microbiome composition of different mammals could provide novel insights into the evolution of mammals and succession of microbial communities in different hosts. However, there is limited information on the gut microbiome composition of marine mammals, especially cetaceans because of sampling constraints. In this study, we investigated the diversity and composition of microbial communities in the stomach, midgut, and hindgut of 2 stranded short-finned pilot whales (Globicephala macrorhynchus) and hindgut of a stranded pygmy sperm whale (Kogia breviceps) by using 16S rRNA gene amplicon sequencing technology. On the basis of the 50 most abundant operational taxonomic units, principal coordinate analysis, and non-metric multidimensional scaling analysis, we confirmed that the gut microbial communities of the 3 whales were different. Our results revealed that the gut microbiome of 1 stranded short-finned pilot whale GM16 was dominated by Firmicutes (mainly Clostridium) and Fusobacteria; whereas that of the other pilot whale GM19 was composed of Gammaproteobacteria and Bacteroidetes (mainly Vibrio and Bacteroides, respectively), probably caused by intestinal disease and antibiotic treatment. The gut microbiome of the pygmy sperm whale was dominated by Firmicutes and Bacteroidetes. Moreover, different gastrointestinal tract regions harbored different microbial community structures. To our knowledge, this is the first report of the gut microbiome of short-finned pilot whales, and our findings will expand our current knowledge on microbial diversity and composition in the gastrointestinal tract of cetaceans.