T he N 6 -met hyladenosi ne reader Y T H N 6 -methyladenosine RNA binding protein 1 (YTHDF1) has been assessed in several tumor types and holds significance in the tumor microenvironment (TME). Furthermore, p53, an important tumor suppressor, is closely associated with the TME. The present study evaluated the roles of YTHDF1 and p53 in regulating the TME in gastric cancer (GC). Genetic alterations in the YTH domain family were analyzed using the cBioPortal database. Expression of YTHDF1 in GC cells and tissues was assessed using the Tumor Immune Estimation Resource (TIMER), Gene Expression Profiling Interactive Analysis (GEPIA), University of Alabama at Birmingham Cancer data analysis portal and Tumor-Immune System Interactions and Drug Bank (TISIDB) databases, along with reverse-transcription-quantitative PCR and western blotting in GC. The prognostic value of multiple tumors was determined using Kaplan-Meier analysis. Correlation analyses were performed using the TIMER, TISIDB and GEPIA databases. Protein-protein interactions of YTHDF1 were predicted using GeneMANIA and HitPredict, and confirmed using co-immunoprecipitation. Gene Ontology and Kyoto Encyclopedia of Genes and Genomes enrichment analyses of the YTHDF1 functional network in GC were performed using LinkedOmics. Genetic alterations revealed that, among the YTH domain family members, YTHDF1 had the highest alteration in GC and was associated with a shorter survival. Additionally, YTHDF1 was significantly negatively associated with the level of CD8 + T cells, B cells, macrophages, dendritic cells (DCs) and neutrophils in GC. Furthermore, tumor associate macrophage-related and DC markers were significantly negatively correlated with YTHDF1 expression, whilst regulatory T cells and T cell exhaustion markers were significantly negatively associated with YTHDF1 expression. In addition, compared with that in p53-nonmutant GC cells, YTHDF1 expression was significantly higher in p53-mutated GC cells, indicating a potential association between YTHDF1 and p53. Analyses using the GeneMANIA and HitPredict databases, and co-immunoprecipitation, demonstrated that YTHDF1 interacted with p53. In conclusion, the findings of the present study indicate that YTHDF1 is associated with a poor prognosis and serves an important role in the TME of GC. We hypothesize, for the first time to the best of our knowledge, that YTHDF1 regulates immune cell infiltration by interacting with p53 in GC, which provides a promising direction for future research.