Nickel oxide (NiOx) nanocrystals have been widely used in inverted (p-i-n) flexible perovskite solar cells (fPSCs) due to their remarkable advantages of low cost and outstanding stability. However, anion and cation impurities such as NO3- widely exist in the NiOx nanocrystals obtained from calcinated nickel hydroxide (Ni(OH)2). The impurities impair the photovoltaic performance of fPSCs. In this work, we report a facile but effective way to reduce the impurities within the NiOx nanocrystals by regulating the Ni(OH)2 crystal phase. We add different alkalis, such as organic ammonium hydroxide and alkali metal hydroxides, to nickel nitrate solutions to precipitate layered Ni(OH)2 with different crystalline phase compositions (α and β mixtures). Especially, Ni(OH)2 with a high β-phase content (such as from KOH) has a narrower crystal plane spacing, resulting in fewer residual impurity ions. Thus, the NiOx nanocrystals, by calcinating the Ni(OH)x with excess β phase from KOH, show improved performance in inverted fPSCs. A champion power conversion efficiency (PCE) of 20.42% has been achieved, which is among the state-of-art inverted fPSCs based on the NiOx hole transport material. Moreover, the reduced impurities are beneficial for enhancing the fPSCs' stability. This work provides an essential but facile strategy for developing high-performance inverted fPSCs.