PURPOSE: To develop a technique that accurately detects the QRS complex in 1.5 Tesla (T), 3T, and 7T MRI scanners. METHODS: During early systole, blood is rapidly ejected into the aortic arch, traveling perpendicular to the MRI's main field, which produces a strong voltage (V(MHD)) that eclipses the QRS complex. Greater complexity arises in arrhythmia patients, since V(MHD) varies between sinus-rhythm and arrhythmic beats. The 3DQRS method uses a kernel consisting of 6 electrocardiogram (ECG) precordial leads (V1-V6), compiled from a 12-lead ECG performed outside the magnet. The kernel is cross-correlated with signals acquired inside the MRI to identify the QRS complex in real time. The 3DQRS method was evaluated against a vectorcardiogram (VCG)-based approach in two premature ventricular contraction (PVC) and two atrial fibrillation (AF) patients, a healthy exercising athlete, and eight healthy volunteers, within 1.5T and 3T MRIs, using a prototype MRI-conditional 12-lead ECG system. Two volunteers were recorded at 7T using a Holter recorder. RESULTS: For QRS complex detection, 3DQRS subject-averaged sensitivity levels, relative to VCG were: 1.5T (100% versus 96.7%), 3T (98.9% versus 92.2%), and 7T (96.2% versus 77.7%). CONCLUSION: The 3DQRS method was shown to be more effective in cardiac gating than a conventional VCG-based method.