An all-digital window discriminator is presented. It is event-driven and does not rely on any external or internal timing references. In addition, it provides an area-efficient implementation of photon counting pixel detectors. The transistor-level implementation of the circuit is presented with its circuit area and timing performance.