Aim: To present the design of an algorithm for pacemaker pulse detection based on high sampling rate digital ECG data. This algorithm is supposed to run in real-time in ECG devices, e.g. patient monitors, etc. Methods: Two channels of 32ksps ECG data are feeding into the algorithm. A two-stage algorithm architecture is designed for the real-time processing purpose. The first stage is to identify potential pacing pulse candidates with less calculation demanding: The data of each channel is firstly preprocessed to attenuate the high-frequency noise and highlight the rising and trailing edges of the pacing pulses; Paired edges are picked up by channels, and pacing pulses candidates are then selected by combining analysis of the edge features (position, amplitude, slew rate, etc.) from each channel. The second stage is to validate the candidates and then generate final detection results with more time-consuming calculation: Detailed morphology features (e.g. width, amplitude, the existence of plateau, etc.) are calculated for each candidate and validated by criteria established from a training dataset; Template matching method is also used when regular morphology patterns are found in the candidates. Results: A training dataset containing 271554 pacing pulses collected from 168 patients is used to tune the feature selection and morphology criteria of the algorithm. A testing dataset containing 310519 pacing pulses collected from 162 patients is used for performance evaluation. The sensitivity and positive predictivity of the algorithm on the training and testing datasets both exceed 99%. Conclusion: The proposed digital pacemaker detection algorithm shows a good performance upon both of the training and testing datasets, and is applicable for clinical settings.