BackgroundAtherosclerosis is the main pathological change in atherosclerotic cardiovascular disease, and its underlying mechanisms are not well understood. The aim of this study was to explore the hub genes involved in atherosclerosis and their potential mechanisms through bioinformatics analysis.MethodsThree microarray datasets from Gene Expression Omnibus (GEO) identified robust differentially expressed genes (DEGs) by robust rank aggregation (RRA). We performed connectivity map (CMap) analysis and functional enrichment analysis on robust DEGs and constructed a protein‒protein interaction (PPI) network using the STRING database to identify the hub gene using 12 algorithms of cytoHubba in Cytoscape. Receiver operating characteristic (ROC) analysis was used to assess the diagnostic potency of the hub genes.The CIBERSORT algorithm was used to perform immunocyte infiltration analysis and explore the association between the identified biomarkers and infiltrating immunocytes using Spearman’s rank correlation analysis in R software. Finally, we evaluated the expression of the hub gene in foam cells.ResultsA total of 155 robust DEGs were screened by RRA and were revealed to be mainly associated with cytokines and chemokines by functional enrichment analysis. CD52 and IL1RN were identified as hub genes and were validated in the GSE40231 dataset. Immunocyte infiltration analysis showed that CD52 was positively correlated with gamma delta T cells, M1 macrophages and CD4 memory resting T cells, while IL1RN was positively correlated with monocytes and activated mast cells. RT-qPCR results indicate that CD52 and IL1RN were highly expressed in foam cells, in agreement with bioinformatics analysis.Conclusions​This study has established that CD52 and IL1RN may play a key role in the occurrence and development of atherosclerosis, which opens new lines of thought for further research on the pathogenesis of atherosclerosis.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12920-023-01531-w.