The aim of our study was to develop and validate a nomogram to predict cancer-specific survival and make a risk stratification system for primary gastrointestinal melanoma. Patients with primary gastrointestinal melanoma in the Surveillance, Epidemiology, and End Results database between 2000 and 2018 were included and randomly divided into the training and validation cohort (8:2). A prediction nomogram of cancer-specific survival was constructed based on the risk factors identified in the multivariate Cox regression. Calibration curve, time-dependent receiver operating characteristic, and decision curve analysis were performed. Further, a risk stratification system was developed based on the nomogram. A total of 433 patients were included. The nomogram was constructed based on age, site, and tumor size, Surveillance, Epidemiology, and End Results (SEER) stage, and therapy. The area under the curves of the nomogram predicting 6-, 12-, and 18-month cancer-specific survival were 0.789, 0.757, and 0.726 for the internal validation and 0.796, 0.763, and 0.795 for the external validation. Calibration curves and decision curve analysis were performed. Further, patients were divided into 2 risk subgroups. The Kaplan-Meier analysis and the log-rank test showed that the risk stratification made well differentiation of patients with different risks of cancerspecific survival. We developed and validated a practical prediction model of cancer-specific survival and a risk stratification system for patients with primary gastrointestinal melanoma, which might be available in clinical practices.