A novel scheme to realize all-optical logic gates is proposed based on nonlinear polarization rotation (NPR) in high nonlinear fiber (HNLF). Two optical signals A and B together with a continuous wave are injected into the HNLF. Due to the optical power variation in HNLF, nonlinear birefringence will be induced between the two polarization axes. Both the optical signal and the continuous wave are filtered out at the output of HNLF. By controlling the optical power and the polarization of the optical signal as well as the polarization of the polarizer with respect to the polarization of optical signal/continuous wave, multiple all-optical logic gates can be realized. The theoretical analysis of the optical logic gates based on NPR in HNLF is provided. And the feasibility of the scheme is demonstrated by realizing all opticaland,not,or,xor,nxor,A B,AB, half-adder and half-subtracter at 10 Gbit/s operation.