A diode is a two-terminal electronic component that conducts current primarily in one direction. It has low resistance in one direction, and high resistance in the other. A diode is a semiconductor device that essentially acts as a one-way switch for current. It allows current to flow easily in one direction, but severely restricts current from flowing in the opposite direction. The most commonly used type of diode today is a semiconductor diode, which is a crystalline piece of semiconductor material with a p–n junction connected to two electrical terminals. The diode can be viewed as an electronic version of a check valve, allowing an electric current to pass in one direction (called the diodes forward direction), while blocking it in the opposite direction (the reverse direction) . This unidirectional behavior is called rectification and is used to convert alternating current (AC) to direct current (DC) .
Diodes are assigned current ratings, and if the rating is exceeded and the diode fails, it may short and either allow current to flow in both directions or halt current from flowing in either direction. Diodes are frequently used to conduct damaging high voltages away from sensitive electronic devices, and they are usually reverse-biased. Diodes can be used for a range of things, from creating sound effects to power supplies. They are also used to limit potential damage from unexpected large spikes in voltage.