An electrocardiogram (ECG or EKG) is a medical test that measures the electrical activity of the heart. It is usually performed to diagnose various heart conditions, such as irregular heartbeats, heart attacks, and other heart-related problems. During an ECG, electrodes are placed on the skin to record the electrical impulses that cause the heart to beat. The resulting data is displayed as a series of waves and can help healthcare providers determine the overall health and function of the heart. ECGs are commonly used in clinical settings, emergency rooms, and cardiac monitoring units.