Ionic liquids (ILs) are extensively utilized for the manipulation of crystallization kinetics of perovskite, morphology optimization, and defect passivation for the fabrication of highly efficient and stable devices. However, comparing ILs with different chemical structures and selecting the appropriate ILs from the many types available to enhance perovskite device performance remains a challenge. In this study, a range of ILs containing different sizes of anions are introduced as additives for assisting in film formation in perovskite photovoltaics. Specifically, ILs with various sizes significantly affects the strength of chemical interaction between ILs and perovskite composition, inducing varying degrees of conversion of lead iodide to perovskite as well as the formation of perovskite films with markedly disparate grain sizes and morphology. Theoretical calculations in conjunction with experimental measurements revealed that small-sized anion can more effectively reduce defect density by filling halide vacancies within perovskite bulk materials, resulting in suppression of charge-carrier recombination, an extended photoluminescence lifetime, and significantly improved device performance. Boosted by ILs with appropriate size, the champion power conversion efficiency of 24.09% for the ILs-treated device is obtained, and the unencapsulated devices retain 89.3% of its original efficiency under ambient conditions for 2000h.