Abstract Background The Union for International Cancer Control (UICC) tumor-node-metastasis (TNM) classification is a key gastric cancer prognosis system. This study aimed to create a new TNM system to provide a reference for the clinical diagnosis and treatment of gastric cancer. Methods A review of gastric cancer patients’ records was conducted in The First Hospital of China Medical University and the Liaoning Cancer Hospital and Institute. Based on patients’ prognoses data, computer-aided unsupervised clustering was performed for all possible TNM staging situations to create a new staging division system. Results The primary outcome measure was 5-year survival, analyzed according to TNM classifications. Computer-aided unsupervised clustering for all TNM staging situations was used to create TNM division criteria that were more consistent with clinical situations. Furthermore, unsupervised clustering for the number of lymph node metastasis in the N stage led to the formulation of a classification method that differs from the existing N stage criteria, and unsupervised clustering for tumor size provided an additional reference for prognosis estimates. Conclusions Finally, we developed a TNM staging system based on the computer-aided unsupervised clustering method; this system was more in line with clinical prognosis data when compared with the 7th edition of UICC gastric cancer TNM classification.