An anode is an electrode through which conventional current flows into a polarized electrical device. A common mnemonic is ACID for "anode current into device". The direction of (positive) electric current is opposite to the direction of electron flow: (negatively charged) electrons flow out the anode to the outside circuit.
The terms anode and cathode do not relate to the voltage polarity of those electrodes but the direction of the current: whether positive charge is flowing into or out of the device. Conventional current quantifies the flow of positive charge. In most cases, positive charge leaves the device via the cathode, and positive charge flows into the device via the anode.
Conventional current depends not only on the direction the charge carriers move, but also the carriers' charge. The currents outside the device are usually carried by electrons in a metal conductor. The flow of electrons is opposite to conventional current because electrons have a negative charge. Consequently, electrons leave the device via the anode, and electrons enter the device through the cathode.
The anode and cathode have slightly different definitions for electrical devices such as diodes and vacuum tubes where the electrode naming is fixed and does not depend on the actual charge flow (current). These devices usually allow substantial current flow in one direction but negligible current in the other direction. Consequently, the electrode names use the terms that have substantial ordinary currents. An ideal diode allows current in one direction but not in the other. The electrode that allows positive charges to flow into it would be the anode, but that electrode would never allow positive charges to flow out, so that ideal diode terminal could never be the cathode. For the ideal diode, it makes sense to always call that terminal the anode. For non-ideal diodes, the electrodes are also given fixed names even though such a diode under reverse bias would have a positive charge flow out of the "anode". For some operating conditions and devices, such as diode breakdown, Zener diodes, or photodiodes, the positive charge flow out of the "anode" could be substantial.
The polarity of voltage on an anode with respect to an associated cathode varies depending on the device type and on its operating mode. In the following examples, the anode is negative in a device that provides power, and positive in a device that consumes power:
In a discharging battery or galvanic cell (diagram at right), the anode is the negative terminal because it is where conventional current flows into "the device" (i.e. the battery cell). This inward current is carried externally by electrons moving outwards, negative charge flowing in one direction being electrically equivalent to positive charge flowing in the opposite direction.