Background: Vitiligo is an autoimmune skin disorder primarily characterized by the absence of melanocytes, leading to the development of white patches on the patient's skin. Narrowband Ultraviolet B (NB-UVB) therapy is among the most effective approaches for stimulating the reformation of hyperpigmentation. This treatment utilizes a narrow spectrum of NBUVB wavelengths ranging from 311 to 313 nm to irradiate the affected area, thereby preventing the destruction of migrating and proliferating melanocytes. Nevertheless, the molecular alterations occurring in both the hair follicle and the interfollicular epidermis during NB-UVB treatment remain unknown. Methods: In this study, we conducted a comprehensive analysis of the consistency of differentially expressed genes (DEGs) within the enrichment pathways both before and after NB-UVB treatment, utilizing a bioinformatics approach. Furthermore, we employed CYTOHUBBA and Random Forest algorithms to identify and sequence hub genes from the pool of DEGs. Following validation of these hub genes through ROC curve analysis, we proceeded to construct an interaction network between these hub genes, miRNA, and drugs. Real-Time Quantitative Polymerase Chain Reaction (RT-qPCR) was used to further verify the difference in the expression of hub genes between the disease group and the control group. Results: Gene Set Enrichment Analysis of DEGs indicated strong associations with vitiligo in most pathways. Subsequently, we conducted Gene Ontology and Metascape enrichment analyses on the overlapping genes from DEGs. We identified key genes (COL11A1, IGFBP7, LOX, NTRK2, SDC2, SEMA4D, and VEGFA) within the Protein-Protein Interaction (PPI) network. We further explored potential drugs that could be used for the clinical treatment of vitiligo through the drug-hub gene interaction network. Finally, the results of RT-qPCR experiments demonstrated that the expression levels of the identified hub genes in both groups were consistent with the bioinformatics analysis results. method: The consistency of differentially expressed genes (DEGs) in the enrichment pathway before and after NB-UVB treatment was analyzed in detail from the perspective of bioinformatics. In addition, hub genes were screened and sequenced from DEGs based on CYTOHUBBA and Random Forest algorithms. After validating the hub genes based on ROC curve analysis, we also constructed the interaction network between the hub genes and miRNA and drugs. We also detected the hub genes by RT-qPCR. Conclusion: The hub genes obtained in this study may be a biomarker related to the development of vitiligo pigmentation. Our research not only contributes to a better understanding of the treatment mechanisms of vitiligo but also provides valuable insights for future personalized medical approaches and targeted therapies for vitiligo. conclusion: The hub genes obtained in this study may be a biomarker related to the development of vitiligo pigmentation.