Self-powered MoS2/GaN p–n heterojunction photodetectors exhibited high sensitivity to deep-UV light with high responsivity, specific detectivity and fast response speeds.