Heart disease is one of the biggest causes of death in Indonesia, one of which is arrhythmia, which is a heart rhythm disturbance or a pattern of rapid changes in normal heart rate. Early detection of arrhythmias is very important in reducing the risk of death. In this study, a machine learning approach was used to classify arrhythmias through ECG signal analysis using the K-Nearest Neighbor (K-NN) and Support Vector Machine (SVM) algorithms. The research results show that the K-NN algorithm managed to achieve an accuracy of 82.61%, while the SVM algorithm achieved an accuracy of 79.35%. This shows that the K-NN algorithm has better performance than SVM in the classification of arrhythmia diseases from ECG signals. With higher accuracy, K-NN can identify arrhythmias more precisely, which is very important in the context of early detection. Accurate early detection allows for quicker and more appropriate medical intervention, thereby reducing the risk of serious complications and death. Implementing a K-NN-based early arrhythmia detection system can be an effective solution to be implemented on a wider scale, such as in hospitals or clinics. With this technology, medical personnel can more quickly and accurately diagnose arrhythmias, so that treatment can be carried out earlier. This is very important considering the high death rate due to heart disease in Indonesia. Overall, this study makes an important contribution to the development of an effective early detection system for arrhythmias. By using the K-NN algorithm which has proven to be more accurate, it is hoped that this system can help reduce the death rate due to heart disease in Indonesia. Additionally, further research is needed to continue improving the accuracy and effectiveness of these systems, as well as to explore the potential use of other machine learning algorithms in the medical field.