An electrocardiogram (EKG/ECG) is a test that uses electrodes placed on the chest to detect and record the electrical activity of the heart. The EKG can show the heart's chambers, the pacemaker that initiates heartbeats, and the depolarization wave that causes the heart muscles to contract by removing the normal electrical distribution of cells before they recover to their resting state.