An electrocardiogram (ECG) is a test that records the electrical activity of the heart. It is commonly used to diagnose heart conditions and to monitor the heart’s functioning.

An ECG is typically done by attaching sensors, called electrodes, to the skin on the chest, arms, and legs. These electrodes pick up the electrical signals produced by the heart and transmit them to a machine, which records them on a sheet of paper or displays them on a computer screen.

ECGs are usually done in a healthcare provider’s office or a hospital setting, and the test itself is quick and painless. It is typically done to help diagnose the cause of symptoms such as chest pain, shortness of breath, palpitations, or dizziness, or to monitor the heart’s functioning in people with known heart conditions.

ECGs can help detect a variety of heart problems, including arrhythmias, heart attacks, and heart muscle damage. They can also be used to monitor the effectiveness of treatment for heart conditions and to detect changes in the heart’s functioning.