An electrocardiogram (ECG or EKG) is a painless test that records the electrical activity of your heart. It helps doctors diagnose various heart conditions by showing the heart’s rhythm, identifying irregularities, and evaluating its overall health. ECGs are commonly used to detect heart attacks, arrhythmias, and other cardiac issues, aiding in prompt and accurate medical treatment.