Xuanwei ham fermentation relies on indigenous and environmental microorganisms, which have abundant microbial resources. However, the traditional method of microbial community determination gives low detection rate of microorganisms. In order to reveal the microbial community of the Xuanwei ham more sufficiently, in this study, the total DNA (deoxyribonucleic acid) of the microbes from samples obtained from two brands of Xuanwei ham (10 samples each) were extracted with kit and SDS‐CTAB method. Afterward, 16S rDNA sequencing was performed to target the 16S rDNA gene V4 variant sequence. The composition and diversity of bacterial communities were analyzed. Results revealed that 872 operational taxonomic units, including 23 phyla, 39 classes, 61 orders, 131 families, and 258 genera, were obtained from the 20 ham samples at a similarity level of 97%. The bacterial diversity in Brand II was richer than that in Brand I. The DNA extracted by SDS‐CTAB could show the bacterial diversity better than that extracted by the kit method. At the genus level, the dominant bacterial communities were Tetragenococcus for Brand I and Acinetobacter for Brand II.