HEPLAB is an EEGLAB extension for the automatic detection of cardiac-related events from the raw ECG signal. Users can choose among three different algorithms for R wave detection and one algorithm for T wave detection. An intuitive Graphical User Interface (GUI) displays cardiac events and allows users to manually correct for artifacts. Events can then be exported to EEGLAB’s EEG structure to facilitate the posterior analysis of the Heartbeat Evoked Potential (HEP). Although HEPLAB was originally designed as an EEGLAB extension it can also be used as a standalone Matlab toolbox.