Nowadays, miniaturized optical integrated circuits make a great evolution in optical microelectronics technology. In data processing chains, the need for an ultra-fast all-optical encoder is necessary for a large data transfer. In this work, we have proposed an all-optical encoder structure based on nonlinear 2D photonic crystals with Kerr effect exploiting a nonlinear polymer material of high third-order optical susceptibility. In addition, to generate the telecommunication domain wavelength at 1.55µm, an optimization of the optical-geometry parameters has been realized. Simulations will be performed using plane wave expansion and finite difference time domain methods. The nonlinear effect allows an excellent average contrast ratio of 39.76 db, as the structure requires a very low threshold intensity estimated at 1.5 mW/µm2. The significant power transmitted to the output is equal to 99% and 0.03% of input power equivalent to logic state “1” and logic state “0” respectively. The proposed structure generates a bit rate of 1.92Tb/s, therefore able to adapt with other ultrafast all-optical circuits.