An electrocardiogram (ECG or EKG) is a quick, noninvasive test that records the electrical signals in your heart. Healthcare providers use it to check your heart's rhythm, diagnose conditions like arrhythmias or heart attacks, and monitor cardiac health.