This study aims to analyze the spatio-temporal patterns of subduction and local fault earthquakes in the Special Region of Yogyakarta using the ST-DBSCAN (Spatio-Temporal Density-Based Spatial Clustering of Applications with Noise) algorithm. A total of 5,403 earthquake events from 2019 to 2024 were clustered using spatial parameters (2–5 km) and a temporal window of 10 days. The results were evaluated using the Davies-Bouldin Index (DBI) and Silhouette Score. In the subduction zone, nine clusters were identified with a DBI of 3.23 and a Silhouette Score of 0.18, indicating moderate separation. Meanwhile, 25 clusters were detected in the local fault zone, particularly around the Opak and Oyo Faults, with a higher DBI of 3.82 and a negative Silhouette Score (-0.14), suggesting overlapping clusters and weak structure. The clustering outcomes correlate with geological features and offer insights for improving earthquake hazard assessment and early warning systems in Yogyakarta.