An electrode is a conductor that is used to make contact with a nonmetallic part of a circuit. Electrodes are commonly used in electrochemical cells (see Figure 1), semiconductors like diodes, and in medical devices.
An electrode is classified as either a cathode or an anode depending on if current is flowing into or out of the electrode. Conventional current flows into a device through its anode and leaves the device through the cathode.
Confusion arises in defining anodes and cathodes because of the ambiguity of the term "current". Electron flow is the correct way to think of current, in which negatively charged electrons move around a circuit. However, before it was determined that negative charge carriers were responsible for current, it was assumed that positive charges were moving to create a current.. Since there are no practical differences in the two ways of describing current, the traditional definition stuck around for some technical terms of circuitry. This is why the cathode is defined as the electrode by which a conventional current leaves a device and the anode as by which a conventional current returns to it (see Figure 2).
In voltaic and electrolytic cells, the cathode is the electrode at which reduction occurs, while oxidation occurs at the anode. This way of defining cathodes and anodes is more widely used in chemistry. Any anions or cations in the cell will also be attracted to the anode and cathode respectively (see Figure 1).