Objective. Transcranial magnetic stimulation in combination with electroencephalography (TMS-EEG) has been widely used to study the reactivity and connectivity of brain regions. In order to efficiently and fast solve the pulse artifacts problem caused by TMS electromagnetic pulses, a three-dimensional adaptive rational quadratic Hermite interpolation algorithm is proposed. Approach. Firstly, a three-dimensional signal matrix is obtained by a signal recombination algorithm, where the removed window is automatically obtained by a derivative threshold. Secondly, the adaptive rational quartic Hermite interpolation algorithm is used to interpolate the removed window. Finally, the performance of the algorithm is verified using simulated and public database data. Main results. The simulation results show that the proposed algorithm improves the SNR by 23.88%~47.60%, reduces the RMSE by 46.52%~81.11%, reduces the average MAE by 47.83%~58.33%, and reduces the time consumption of the proposed algorithm by 45.90% compared with the piecewise cubic Hermite interpolation algorithm. Significance. Therefore, TMS-EEG pulse artifacts can be removed effectively and quickly with the proposed algorithm.