Abstract Background Microbiome changes on the ocular surface may cause dry eyes. A metagenome assay was used to compare the microbiome composition and function of the ocular surface between diabetic children and adolescents with dry eye, diabetic children and adolescents without dry eye, and normal children. Materials and methods Twenty children and adolescents aged 8 to 16 with diabetes were selected from the Shanghai Children and Adolescent Diabetes Eye Study. Ten healthy children and adolescents belonging to the same age group were selected from the outpatient clinic during the same period. The participants were classified into the dry eye group (DM-DE group, n = 10), the non-dry eye group (DM-NDE group, n = 10) and the normal group (NDM group, n = 10). A conjunctival sac swab was collected for metagenomic sequencing, and the relationship between the microbiome composition and functional gene differences on the ocular surface with dry eye was studied. Results The classification composition and metabolic function of the microorganisms on the ocular surface of children in the 3 groups were analyzed. It was found that children’s ocular microbiota was composed of bacteria, viruses and fungi. There were significant differences in α diversity and β diversity of microbial composition of ocular surface between DM-DE group and NDM group(P