RNA methylation normally inhibits the self-recognition and immunogenicity of RNA. As such, it is likely an important inhibitor of cancer immune recognition in the tumor microenvironment, but how N6-methyladenosine (m6A) affects prognosis and treatment response remains unknown. In eight independent melanoma cohorts (1,564 patients), the modification patterns of 21 m6A gene signatures were systematically correlated with the immune cell infiltration of melanoma tumor microenvironment. m6A modification patterns for each patient were quantified using the principal component analysis method, yielding an m6Ascore that reflects the abundance of m6A RNA modifications. Two different m6A modification patterns were observed in patients with melanoma, separated into high and low m6Ascores that correlated with survival and treatment response. Low m6Ascores were characterized by an immune-inflamed phenotype, with 61.1% 5-year survival. High m6Ascores were characterized by an immune-excluded phenotype, with 52.2% 5-year survival. Importantly, lower m6Ascores correlated with more sensitive anti-PD-1 and anti-CTLA4 treatment responses, with 90% of patients with low m6Ascore responding, whereas 10% of those with high m6Ascore nonresponding (in cohort GSE63557). At single-cell and spatial transcriptome resolution, m6Ascore reflects melanoma malignant progression, immune exhaustion, and resistance to immune checkpoint blockade therapy. Hence, the m6Ascore correlates to an important facet of tumor immune escape as a tool for personalized medicine to guide immunotherapy in patients with melanoma.