BACKGROUND: Personalized prediction of treatment outcomes can aid patients with cancer when deciding on treatment options. Existing prediction models for esophageal and gastric cancer, however, have mostly been developed for survival prediction after surgery (ie, when treatment has already been completed). Furthermore, prediction models for patients with metastatic cancer are scarce. The aim of this study was to develop prediction models of overall survival at diagnosis for patients with potentially curable and metastatic esophageal and gastric cancer (the SOURCE study). METHODS: Data from 13,080 patients with esophageal or gastric cancer diagnosed in 2015 through 2018 were retrieved from the prospective Netherlands Cancer Registry. Four Cox proportional hazards regression models were created for patients with potentially curable and metastatic esophageal or gastric cancer. Predictors, including treatment type, were selected using the Akaike information criterion. The models were validated with temporal cross-validation on their C-index and calibration. RESULTS: The validated model's C-index was 0.78 for potentially curable gastric cancer and 0.80 for potentially curable esophageal cancer. For the metastatic models, the c-indices were 0.72 and 0.73 for esophageal and gastric cancer, respectively. The 95% confidence interval of the calibration intercepts and slopes contain the values 0 and 1, respectively. CONCLUSIONS: The SOURCE prediction models show fair to good c-indices and an overall good calibration. The models are the first in esophageal and gastric cancer to predict survival at diagnosis for a variety of treatments. Future research is needed to demonstrate their value for shared decision-making in clinical practice.