An electrocardiogram (ekg or ecg) is a test that checks for problems with the electrical activity of your heart. An ekg shows the heart’s electrical activity as line tracings on paper. It is necessary to diagnose heart conditions such as infarction, arrhythmias, palpitations and other dangerous heart conditions.