Distant metastasis (DM) is relatively uncommon in T1 stage gastric cancer (GC). The aim of this study was to develop and validate a predictive model for DM in stage T1 GC using machine learning (ML) algorithms. Patients with stage T1 GC from 2010 to 2017 were screened from the public Surveillance, Epidemiology and End Results (SEER) database. Meanwhile, we collected patients with stage T1 GC admitted to the Department of Gastrointestinal Surgery of the Second Affiliated Hospital of Nanchang University from 2015 to 2017. We applied seven ML algorithms: logistic regression, random forest (RF), LASSO, support vector machine, k-Nearest Neighbor, Naive Bayesian Model, Artificial Neural Network. Finally, a RF model for DM of T1 GC was developed. The AUC, sensitivity, specificity, F1-score and accuracy were used to evaluate and compare the predictive performance of the RF model with other models. Finally, we performed a prognostic analysis of patients who developed distant metastases. Independent risk factors for prognosis were analysed by univariate and multifactorial regression. K-M curves were used to express differences in survival prognosis for each variable and subvariable. A total of 2698 cases were included in the SEER dataset, 314 with DM, and 107 hospital patients were included, 14 with DM. Age, T-stage, N-stage, tumour size, grade and tumour location were independent risk factors for the development of DM in stage T1 GC. A combined analysis of seven ML algorithms in the training and test sets found that the RF prediction model had the best prediction performance (AUC: 0.941, Accuracy: 0.917, Recall: 0.841, Specificity: 0.927, F1-score: 0.877). The external validation set ROCAUC was 0.750. Meanwhile, survival prognostic analysis showed that surgery (HR = 3.620, 95% CI 2.164–6.065) and adjuvant chemotherapy (HR = 2.637, 95% CI 2.067–3.365) were independent risk factors for survival prognosis in patients with DM from stage T1 GC. Age, T-stage, N-stage, tumour size, grade and tumour location were independent risk factors for the development of DM in stage T1 GC. ML algorithms had shown that RF prediction models had the best predictive efficacy to accurately screen at-risk populations for further clinical screening for metastases. At the same time, aggressive surgery and adjuvant chemotherapy can improve the survival rate of patients with DM.