A gradual transition from electrical to optical networks is accompanying the rapid progress of telecommunication technology. The urge for enhanced transmission capacity and speed is dictating this trend. In fact, large volumes of data encoded on optical signals can be transported rapidly over long distances. Their propagation along specific routes across a communication network is ensured by a combination of optical fibers and optoelectronic switches. It is becoming apparent, however, that the interplay between the routing electrical stimulations and the traveling optical signals will not be able to support the terabit-per-second capacities that will be needed in the near future. Electrical inputs cannot handle the immense parallelism potentially possible with optical signals. Operating principles to control optical signals with optical signals must be developed. Molecular and supramolecular switches are promising candidates for the realization of innovative materials for information technology. Binary digits can be encoded in their chemical, electrical, or optical inputs and outputs to execute specific logic functions. We have developed a simple strategy to gate optical signals with optical signals by using a photoactive molecular switch. We have demonstrated that NAND, NOR, and NOT operations can be implemented exclusively with optical inputs and optical outputs coupling from one to three switching elements. Our remarkably simple approach to all-optical switching might lead to the development of a new generation of devices for digital processing and communication technology.