All-inorganic cesium lead iodide (CsPbI 3 ) perovskites, which replace volatile and hygroscopic organic components with stable inorganic cesium cations, have promising photoelectronic properties for potential application in solar cells. However, highly stable and efficient CsPbI 3 -based perovskite solar cells are rarely reported because the optically active black phases of CsPbI 3 tend to change into a photo-inactive yellow δ-phase. Herein, a highly stable CsPbI 3 film that is formed by introducing a small quantity of zwitterions with different dimensions to the perovskite precursor solution is reported. The zwitterions effectively inhibit the formation of the yellow δ-phase during perovskite crystallization and promote the development of a stable black α-phase. In addition, a systematic analysis reveals strong interaction between 3D zwitterions and perovskites in both the solution and film states, which leads to a dense and pinhole-free CsPbI 3 film with suppressed trap states. The resulting perovskite solar cells with 3D zwitterions achieve a significantly improved power conversion efficiency of 18.4% with high reproducibility. The devices without encapsulation retain 98% of the initial efficiency after 25 days at 25 °C and relative humidity of 25% ± 5%. Importantly, the 3D zwitterionbased devices demonstrate excellent phase stability when subjected to thermal aging at 100 °C.