A pacemaker is a small device implanted in the chest to help control your heartbeat. It's used when the heart beats too quickly, too slowly or irregularly due to a heart attack, heart failure or another problem that has damaged the heart's natural electrical system. A pacemaker mimics that system by sending out painless electrical signals that stimulate heart muscle contraction – the first part of the heart's pumping action. Having a pacemaker can relieve the dizziness, fainting episodes and shortness of breath caused by a slow or unsteady heartbeat.

A pacemaker is battery powered. Most consist of two parts: the pulse generator, a small metal container about the size of a matchbox that contains the battery and electronics, and the leads, thin wires that conduct the electrical signals. Most pacemakers are placed under the skin of the chest and connected to the heart through the leads. But there are also leadless pacemakers, which are placed directly in the heart through a minimally invasive procedure.

Pacemakers are usually implanted as a permanent treatment. But they're sometimes used as a temporary measure to stabilize heart rhythms in people recovering from a heart attack, heart surgery or a medication overdose that slowed their heart rate.