Aims To develop a prediction algorithm to rule out diabetic ketoacidosis (DKA) and non-ketotic hyperosmolar syndrome (NKHS) based on vital signs for early triage of patients with diabetes. Methods The subjects were consecutive adult diabetic patients with hyperglycemia (blood glucose ≥250 mg/dl) who presented at an emergency department. Based on a derivation sample ( n = 392, 70% of 544 patients at a hospital in Okinawa), recursive partitioning analysis was used to develop a tree-based algorithm. Validation was conducted using the other 30% of the patients in Okinawa ( n = 152, internal validation) and patients at a hospital in Tokyo ( n = 95, external validation). Results Three risk groups for DKA/NKHS were identified: a high-risk group of patients with glucose >400 mg/dl or systolic blood pressure <100 mmHg; a low risk group of patients with glucose ≤400 mg/dl and normal vital signs (systolic blood pressure ≥100 mmHg, pulse ≤90/min, and respiratory rate ≤20/min); and an intermediate risk group. The prevalences of DKA/NKHS were 2% (derivation set), 0% (internal validation set), and 0% (external validation set) in the low risk group, respectively. Conclusions Our algorithm may help DKA/NKHS triage and patients with normal vital signs can be initially triaged as low risk for DKA/NKHS.