An electrocardiogram is a painless, noninvasive way to help diagnose many common heart problems. A health care provider might use an electrocardiogram to determine or detect:
Irregular heart rhythms (arrhythmias)
If blocked or narrowed arteries in the heart (coronary artery disease) are causing chest pain or a heart attack
Whether you have had a previous heart attack
How well certain heart disease treatments, such as a pacemaker, are working
You may need an ECG if you have any of the following signs and symptoms:
Chest pain
Dizziness, lightheadedness or confusion
Heart palpitations
Rapid pulse
Shortness of breath
Weakness, fatigue or a decline in ability to exercise