An all-optical differential phase-shift keying (DPSK) regenerator with a DPSK demodulator and a conventional on–off keying (OOK) regenerator requires a DPSK encoding process that is realized by T-type flip-flop (T-FF) operation. To solve this problem, we propose an all-optical T-FF circuit consisting of counter-faced semiconductor optical amplifier (SOA)-based exclusive OR (XOR) gates for the first time. Numerical investigation with rate equation reveals the possibility of its stable operation in 10 Gbps with 27-1 pseudorandom binary sequence (PRBS) signal. It also reveals that it is necessary to decrease the equivalent turn-off time for high bit-rate operation using push–pull configuration.