The passivation of perovskite surface defects is crucial to achieving perovskite solar cells with high performance and stability, but universal strategies remain elusive. Now, a passivation strategy is developed that has a broad processing window and shows applicability to various perovskite compositions and device architectures.