We proposed a versatile polarizer independent with the polarization of the incident light by coating the graphene on the silicon waveguide. The proposed polarizer works at two operation states: TE-pass state and TM-pass state, where the variation of mode effective index is different for the two states. Therefore it is able to combine TE-pass and TM-pass polarizer into one single component. The proposed device owns a compact size of 69.65μm∗2μm, high extinction ratio 19.15dB for TE-pass polarizer and 20.68dB for TM-pass polarizer, respectively. Furthermore, this device exhibits a wide working bandwidth from 1500nm to 1800nm.