The content of medicinal components of Codonopsis pilosula differ greatly in various habitats. The development of specific molecular markers is of great significance for the identification of different varieties of C. pilosula . In this study, 1,379,041 primer pairs were designed based on the whole genome of C. lanceolata . Of these, 6 pairs of primers were able to amplify polymorphic bands. We performed genetic diversity analysis and constructed a cluster tree and DNA fingerprint of the three groups: mixed, wild and cultivated C. pilosula materials. The results were as follows: first, the mixed materials had an average observed number of alleles ( Na ) of 7.6667, an average effective number of alleles ( Ne ) of 4.6058, an average Shannon's information index ( I ) of 1.7128, an average expected homozygosty ( Exp Hom ) of 0.2118, an average expected heterozygosity ( Exp Het ) of 0.7882, an average expected heterozygosity of Nei’s ( Ht ) of 0.7798, and an average gene flow ( Nm ) of 0.1281. Second, the cultivated accessions were as follows: Na = 4.6667, Ne = 2.5956, I = 1.0702, Exp Hom = 0.4234, Exp Het = 0.5766, Ht = 0.5755, and Nm = 0.5253. Finally, the accessions of the wild materials were as follows: Na = 5.333, Ne = 2.8769, I = 1.2771, Exp Hom = 0.3556, Exp Het = 0.6444, Ht = 0.6433, and Nm = 0.5314. In addition, the results of cluster analysis showed that mixed, wild and cultivated materials were clustered into 4, 4 and 3 subgroups, respectively. Furthermore, we performed DNA fingerprinting of 47 mixed materials. These results are valuable for the identification and genetic analysis of C. pilosula from different sources in Shanxi Province.