The invention relates to a self-testing proximity switch with a test circuit generating test pulses. According to the invention, the comparator of the proximity switch is constructed as a comparator with threshold switching, and the switching thresholds of the comparator can be switched with the aid of test pulses in such a manner that short-time changes of the output signal of the proximity switch are generated, the occurrence of which indicates that all circuits of the proximity switch operate correctly.