Accurately predicting which patients will respond to immune checkpoint blockade (ICB) remains a major challenge. Here, we present TIME_ACT, an unsupervised 66-gene transcriptomic signature of tumor immune activation derived from TCGA melanoma data. First, TIME_ACT scores accurately identify tumors with activated immune microenvironments across cancer types. Analysis of spatial features of the tumor microenvironment revealed that TIME_ACT-high regions exhibit dense lymphocyte infiltration near tumor cells, indicating localized immune activation. Second, in 15 anti-PD1 transcriptomic cohorts spanning six cancer types, TIME_ACT outperforms 22 established signatures and methods, achieving a mean AUC of 0.76 and a clinically meaningful mean odds ratio of 6.11. Thirdly, TIME_ACT scores can be accurately inferred from tumor histopathology slides. Finally, slide-inferred TIME_ACT scores predict ICB response across eight unseen cohorts, achieving a mean AUC of 0.72 and a mean odds ratio of 5.02. These findings establish TIME_ACT as a robust, pan-cancer, and low-cost predictor of ICB response.