BackgroundOdontogenic keratocyst (OKC) is a relatively common odontogenic lesion characterized by local invasion in the maxillary and mandibular bones. In the pathological tissue slices of OKC, immune cell infiltrations are frequently observed. However, the immune cell profile and the molecular mechanism for immune cell infiltration of OKC are still unclear. We aimed to explore the immune cell profile of OKC and to explore the potential pathogenesis for immune cell infiltration in OKC.MethodsThe microarray dataset GSE38494 including OKC and oral mucosa (OM) samples were obtained from the Gene Expression Omnibus (GEO) database. The differentially expressed genes (DEGs) in OKC were analyzed by R software. The hub genes of OKC were performed by protein-protein interaction (PPI) network. The differential immune cell infiltration and the potential relationship between immune cell infiltration and the hub genes were performed by single-sample gene set enrichment analysis (ssGSEA). The expression of COL1A1 and COL1A3 were confirmed by immunofluorescence and immunohistochemistry in 17 OKC and 8 OM samples.ResultsWe detected a total of 402 differentially expressed genes (DEGs), of which 247 were upregulated and 155 were downregulated. DEGs were mainly involved in collagen-containing extracellular matrix pathways, external encapsulating structure organization, and extracellular structure organization. We identified ten hub genes, namely FN1, COL1A1, COL3A1, COL1A2, BGN, POSTN, SPARC, FBN1, COL5A1, and COL5A2. A significant difference was observed in the abundances of eight types of infiltrating immune cells between the OM and OKC groups. Both COL1A1 and COL3A1 exhibited a significant positive correlation with natural killer T cells and memory B cells. Simultaneously, they demonstrated a significant negative correlation with CD56dim natural killer cells, neutrophils, immature dendritic cells, and activated dendritic cells. Immunohistochemistry analysis showed that COL1A1 (P= 0.0131) and COL1A3 (P< 0.001) were significantly elevated in OKC compared with OM.ConclusionsOur findings provide insights into the pathogenesis of OKC and illuminate the immune microenvironment within these lesions. The key genes, including COL1A1 and COL1A3, may significantly impact the biological processes associated with OKC.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12903-023-03175-9.