Sleep spindles are a hallmark electroencephalographic feature of non-rapid eye movement sleep, and are believed to be instrumental for sleep-dependent memory reactivation and consolidation. However, direct proof of their causal relevance is hard to obtain, and our understanding of their immediate neurophysiological consequences is limited. To investigate their causal role, spindles need to be targeted in real-time with sensory or non-invasive brain-stimulation techniques. While fully automated offline detection algorithms are well established, spindle detection in real-time is highly challenging due to their spontaneous and transient nature. Here, we present the real-time spindle detector, a robust multi-channel electroencephalographic signal-processing algorithm that enables the automated triggering of stimulation during sleep spindles in a phase-specific manner. We validated the real-time spindle detection method by streaming pre-recorded sleep electroencephalographic datasets to a real-time computer system running a Simulink® Real-Time™ implementation of the algorithm. Sleep spindles were detected with high levels of Sensitivity (~83%), Precision (~78%) and a convincing F1-Score (~81%) in reference to state-of-the-art offline algorithms (which reached similar or lower levels when compared with each other), for both naps and full nights, and largely independent of sleep scoring information. Detected spindles were comparable in frequency, duration, amplitude and symmetry, and showed the typical time-frequency characteristics as well as a centroparietal topography. Spindles were detected close to their centre and reliably at the predefined target phase. The real-time spindle detection algorithm therefore empowers researchers to target spindles during human sleep, and apply the stimulation method and experimental paradigm of their choice.