Several studies have reported a significant relationship between Ephrin receptor A2 (EphA2) and malignant progression in numerous cancers. However, there is a lack of comprehensive pan-cancer analysis on the prognostic value, mutation status, methylation landscape, and potential immunological function of EphA2. Using The Cancer Genome Atlas, Genotype Tissue Expression Database and GEO data, we analysed the differences in EphA2 expression between normal and tumour tissues and the effects of EphA2 on the prognosis of different tumours. Furthermore, using GSCALite, cBioPortal, TISDB, ULCLAN and TIMER 2.0 databases or platforms, we comprehensively analysed the potential oncogenic mechanisms or manifestations of EphA2 in 33 different tumour types, including tumour mutation status, DNA methylation status and immune cell infiltration. The correlation of EphA2 with immune checkpoints, tumour mutational burden, DNA microsatellite instability and DNA repair genes was also calculated. Finally, the effects of EphA2 inhibitors on the proliferation of human glioma and lung cancer cells were verified in cellular experiments. EphA2 is differentially expressed in different tumours, and patients with overexpression have poorer overall survival. In addition, gene mutations, gene copy number variation and DNA/RNA methylation of EphA2 have been identified in various tumours. Moreover, EphA2 is positively associated with immune infiltration involving macrophages and CD8+ T cells. Further, EphA2 mRNA expression is significantly associated with immune checkpoint in various cancers, especially programmed death-ligand 1. Finally, the EphA2 inhibitor ALW-II-41-27 shows potent anti-tumour activity. Our first pan-cancer study of EphA2 provides insight into the prognostic and immunological roles of EphA2 in different tumours, suggesting that EphA2 might be a potential biomarker for poor prognosis and immune infiltration in cancer.