Carbon nitride (CN) is an ideal candidate as a passivating agent for perovskite (PVK) due to its large π-conjugated structure and rich surface functional groups. Unfortunately, its intrinsic two-dimensional (2D) multilayer structure decreases the interlayer charge transfer, which is not conducive to the high efficiency of perovskite solar cells (PSCs). Here, layered double hydroxides (LDHs) provide a confinement space to control the growth of CN, giving it atomic thickness and reduced interlayer distance, which improves the interlayer charge transfer. The rich functional groups (−NH 2 and −OH) on the surface of the CN nanosheets can facilitate bonding to PVK, which provides a prerequisite for obtaining higher-quality PVK crystals. The synergy effect mentioned above allows the all-air processed carbon-based PSCs to reach a decent power conversion efficiency of 12.57%. Therefore, the exploration of ultrathin CN nanosheets with a larger π-conjugate structure to improve the quality of PVK will guide the advanced application of 2D materials in PSCs.