An electrocardiogram (ECG/EKG) is a simple, painless test that measures the heart’s electrical activity. Every heartbeat is triggered by an electrical signal that starts at the top of the heart and travels to the bottom. The doctor may recommend an ECG/EKG if there are symptoms or signs that may suggest a heart problem, including: