Electrocardiogram (ECG) signal is important for physician to diagnose diseases. Various existing techniques on ECG classification have been reported. Generally, these techniques classify only two or three arrhythmias and need significantly long processing time. A new algorithm based on Support vector machine (SVM) is presented to solve the problem in this paper, which has been successfully applied to the classification of ECG. And in this paper are clarified the fundamental ideas of the classification of ECG based on SVM. Compared with the traditional neural network, this method is superior to it in theory. Because this new method deals with the minimization of the test samples, not the training samples.