The ballistocardiogram (BCG), the induced electric potentials by the head motion originating from heartbeats, is a prominent source of noise in electroencephalography (EEG) data during magnetic resonance imaging (MRI). Although methods have been proposed to suppress the BCG artifact, more work considering the variability of cardiac cycles and head motion across time and subjects is needed to provide highly robust correction. Here, a method called “dynamic modeling of heartbeats” (DMH) is proposed to reduce BCG artifacts in EEG data recorded inside an MRI system. The DMH method models BCG artifacts by combining EEG points at time instants with similar dynamics. The modeled BCG artifact is then subtracted from the EEG recording to suppress the BCG artifact. Performance of DMH was tested and specifically compared with the Optimal Basis Set (OBS) method on EEG data recorded inside a 3T MRI system with either no MRI acquisition (Inside-MRI), echo-planar imaging (EPI-EEG), or fast MRI acquisition using simultaneous multi-slice and inverse imaging methods (SMS-InI-EEG). In a steady-state visual evoked response (SSVEP) paradigm, the 15-Hz oscillatory neuronal activity at the visual cortex after DMH processing was about 130% of that achieved by OBS processing for Inside-MRI, SMS-InI-EEG, and EPI-EEG conditions. The DMH method is computationally efficient for suppressing BCG artifacts and in the future may help to improve the quality of EEG data recorded in high-field MRI systems for neuroscientific and clinical applications.