Flexible ultraviolet (UV) photodetectors are considered as potential building blocks for future-oriented photoelectric applications such as flexible optical communication, image sensors, wearable devices and so on. In this work, high-performance UV photodetector was fabricated via a facile combination of single ZnO microwire (MW) and p-type polyaniline. Due to the formation of effective organic/inorganic p-n junction, the as-prepared flexible UV photodetector based on ZnO MW/polyaniline hybrid heterojunction exhibits high performance (responsivity ∼ 60 mA/W and detectivity ∼ 2.0 ×10 11 Jones) at the reverse bias of −1 V under the UV illumination. The ZnO MW/polyaniline photodetector displays short response/recovery times (∼ 0.44 s/∼ 0.42 s), which is less than that of most reported UV photodetectors based on ZnO/polymer heterojunction. The fast response speed and recovery speed can be attributed to the high crystallinity of ZnO MW, built-in electric field in space-charge region and the passivation of oxygen traps on the surface. Further, the photodetector using ZnO MW/polyaniline junctions shows excellent flexibility and stability under bent conditions. This work opens a new way to design next-generation high-performance, low-cost and flexible optoelectronic devices for lab-on-a-chip applications.