Abstract:[Background] Lactobacillus plantarum widely exists in many ecological environments, such as plants, dairy products, meat products and the intestines of mammals and insects. [Objective] To explore the potential link between genetic variability and environmental origin of L. plantarum isolates. [Methods] The genetic diversity and functional genome of 126 L. plantarum strains isolated from plants, dairy products, meat products, drosophila, mammals’ gut as well as mammals’ oral cavity and other locations, were deciphered by comparative genomic analysis to understand the genetic relationship and evolutionary history. [Results] The genomic size and number of coding genes of L. plantarum isolated from drosophila were significantly higher than those isolated from plants, mammals gut, meat products and dairy products (P<0.05), but there was no significant difference among plants, mammals gut, mammals oral cavity and other locations as well as meat products isolates. Both phylogenetic trees constructed based on single copy genes and core genes showed that drosophila isolates and dairy products isolates are clustered in a branch, respectively. while other isolates were evenly distributed into each branch. The results based on accessory genes analysis were consistent with the results based on the phylogenetic tree analysis. The analysis of functional genome showed that habitat-specific genes of drosophila isolates were involved in the metabolism of fructooligosaccharides and chitin, habitat-specific genes of dairy products isolates were involved in mazEF toxin-antitoxin system and CRISPR system. [Conclusion] L. plantarum strains isolated from drosophila and dairy products may have undergone adaptive evolution in order to adapt to the unique habitat. These results provided a new insight for the adaptive evolution and provided theoretical basis for analyzing the evolution process of L. plantarum.