An algorithm is presented for the detection and correction of errors in cardiac interbeat interval data. Detection of errors is based on the assumption that the beat-to-beat variation in R-R intervals cannot exceed certain critical percentages of the preceding interval. Detected errors are corrected by merging the questionable internal with the preceding or the succeeding interval, or by subdividing it, in such manner that the resultant beat-to-beat variability, is minimized. The algorithm is shown mathematically to be capable of detecting errors in data with extreme beat-to-beat variability. Empirical experience with the algorithm suggests that it corrects errors satisfactorily under vigorous conditions.