Two-dimensional (2D) all-inorganic halide perovskites exhibit impressive optical and electrical properties, which are attracting extensive current interests. Rare earth (RE) ions doping is a significant method to adjust their optical, electrical properties and realize various applications. However, 2D RE ions-doped perovskite crystals have been rarely reported. Herein, we reported the synthesis of novel 2D all-inorganic perovskite CsPbClxBr3−x nanosheets (NSs) doped with RE ions. The octylamine (OLAm) with short carbon chains is used to tune the growth orientation for the preparation of 2D perovskite NSs. The morphology of the NSs can be adjusted by varying the ratio of shorter ligands to longer ligands and changing the temperature. The Yb3+ ions doped CsPbClBr2 NSs demonstrate an excitonic emission of perovskite host and a quantum cutting emission of Yb3+ ions at 985 nm with the optimal photoluminescence quantum yield (PLQY) of 128%. The results of femtosecond time-resolved transient absorption spectroscopy and DFT calculations indicate that the defect density of NSs is largely decreased and the photostability is enhanced induced by the passivation effect of Yb3+ ions. The photodetector (PD) based on lateral assembled Yb3+ ions doped CsPbClBr2 NS film is fabricated, which demonstrates a high responsivity and dual-band detection capability. The as-fabricated PDs are sensitive to both UV and NIR light, showing the responsivity of 1.96 A W−1, 0.12 mA W−1, the detectivity of 5 × 1012, 2.15 × 109 Jones at 440 nm and 980 nm, respectively. Finally, based on an imaging system with a PD array and a data analysis system, visual photoelectric detection is realized, and high-contrast images of the measured UV and NIR light are displayed. This work paves the way to tune the properties of 2D perovskite materials and develop high-performance optoelectronic devices.