Background Mammalian commensal microbiota play important roles in the health of its host. In comparison to terrestrial mammals, commensal microbiota of marine mammals is mainly focused on the composition and function of skin and gut microbiota, with less attention paid to the health impact of bacteria and viruses. Previous studies on sperm whales (Physeter catodon) have affirmed their important phylogenetic position; however, studies on their commensal microbiota have not been published, due to difficulty in sample collection. Methods Here, we sequenced the metagenomes of blood, muscle and fecal samples from a stranded sperm whale using the BGISEQ-500 platform. We compared the diversity and abundance of microbiomes from three different tissues and tried to search pathogenic bacterial and virulence genes probably related to the health of the sperm whale. We also performed 16S rDNA sequencing of the fecal sample to compare to published gut metagenome data from other marine mammals. Results Our results demonstrated notable differences in species richness and abundance in the three samples. Extensive bacteria, including Enterococcus faecium, Fusobacterium nucleatum, Pseudomonas aeruginosa, Streptococcus anginosus, Streptococcus pneumoniae, and Streptococcus suis, and five toxigenic Clostridium species usually associated with infection, were found in the three samples. We also found the taxa composition of sperm whale gut microbiota was similar to that of other whales, suggesting co-evolution with its host. This study is the first report of the sperm whale gut microbiome, and provides a foundation for the pathogen detection and health assessment of the sperm whale.