Solution-processable all-inorganic CsPbI3-xBrx perovskite holds great potential for pure red light-emitting diodes. However, the widely existing defects in this mixed halide perovskite markedly limit the efficiency and stability of present light-emitting diode devices. We here identify that intragrain Ruddlesden-Popper planar defects are primary forms of such defects in the CsPbI3-xBrx thin film owing to the lattice strain caused by inhomogeneous halogen ion distribution. To eliminate these defects, we develop a stepwise metastable phase crystallization strategy to minimize the CsPbI3-xBrx perovskite lattice strain, which brings planar defect-free CsPbI3-xBrx thin film with improved radiative recombination, narrowed emission band, and enhanced spectral stability. Using these high-quality thin films, we fabricate spectrally stable pure red perovskite light-emitting diodes, showing 17.8% external quantum efficiency and 9000 candela meter-2 brightness with color coordinates required by Rec. 2020.