As a consequence of recent technological advances in the field of functional magnetic resonance imaging (fMRI), results can now be made available in real-time. This allows for novel applications such as online quality assurance of the acquisition, intra-operative fMRI, brain-computer-interfaces, and neurofeedback. To that aim, signal processing algorithms for real-time fMRI must reliably correct signal contaminations due to physiological noise, head motion, and scanner drift. The aim of this study was to compare performance of the commonly used online detrending algorithms exponential moving average (EMA), incremental general linear model (iGLM) and sliding window iGLM (iGLM(window)). For comparison, we also included offline detrending algorithms (i.e., MATLAB's and SPM8's native detrending functions). Additionally, we optimized the EMA control parameter, by assessing the algorithm's performance on a simulated data set with an exhaustive set of realistic experimental design parameters. First, we optimized the free parameters of the online and offline detrending algorithms. Next, using simulated data, we systematically compared the performance of the algorithms with respect to varying levels of Gaussian and colored noise, linear and non-linear drifts, spikes, and step function artifacts. Additionally, using in vivo data from an actual rte-fMRI experiment, we validated our results in a post hoc offline comparison of the different detrending algorithms. Quantitative measures show that all algorithms perform well, even though they are differently affected by the different artifact types. The iGLM approach outperforms the other online algorithms and achieves online detrending performance that is as good as that of offline procedures. These results may guide developers and users of real-time fMRI analyses tools to best account for the problem of signal drifts in real-time fMRI.