An electrocardiogram (ECG or EKG) is a non-invasive test that measures the electrical activity of the heart. It records the heart's rhythm and activity on a moving strip of paper or a digital screen. By analyzing the electrical impulses, healthcare providers can identify various heart conditions.