A molecular switch is a molecule that can reversibly transition between two or more distinct states in response to external stimuli such as light, pH, electric field, or chemical environment. This ability to toggle between states makes molecular switches fundamental components in the field of nanotechnology, where they can be used for various applications ranging from molecular electronics to targeted drug delivery systems.