There is a lack of useful biomarkers for predicting the efficacy of anti–programmed death-1 (PD-1) therapy for advanced gastric and colorectal cancer. To address this issue, in this study we investigated the correlation between inflammatory marker expression and survival in patients with advanced gastric and colorectal cancer. Data for 111 patients with advanced gastric and colorectal cancer treated with anti–PD-1 regimens were retrospectively analyzed. Neutrophil-to-lymphocyte ratio (NLR), monocyte-to-lymphocyte ratio (MLR), platelet-to-lymphocyte ratio (PLR), and clinical characteristics of each patient were selected as the main variables. Overall response rate, disease control rate, and progression-free survival were primary endpoints, and overall survival and immune-related adverse events (irAEs) were secondary endpoints. The chi-squared test and Fisher’s exact test were used to evaluate relationships between categorical variables. Uni- and multivariate Cox regression analyses were performed, and median progression-free survival and overall survival were estimated with the Kaplan–Meier method. The overall response rate and disease control rate of anti–PD-1therapy in advanced gastric and colorectal tumors were 12.61 and 66.66%, respectively. The patients with MLR < 0.31, NLR < 5, and PLR < 135 had a significantly higher disease control rate than those with MLR > 0.31, NLR > 5, and PLR > 135 (P < 0.05). The multivariate analysis revealed that MLR < 0.31, BMI > 18.5, and anti–PD-1 therapy in first-line were associated with prolonged PFS. MLR < 0.31 and BMI > 18.5 were associated with prolonged overall survival. The irAE rate differed significantly between PLR groups, and PLR < 135 was associated with an increased rate of irAEs (P = 0.028). These results indicate that the inflammatory markers NLR, MLR, and PLR have clinical utility for predicting survival or risk of irAEs in patients with advanced gastric cancer and colorectal cancer.