The use of layered perovskites is an important strategy to improve the stability of hybrid perovskite materials and their optoelectronic devices. However, tailoring their properties requires accurate structure determination at the atomic scale, which is a challenge for conventional diffraction-based techniques. We demonstrate the use of nuclear magnetic resonance (NMR) crystallography in determining the structure of layered hybrid perovskites for a mixed-spacer model composed of 2-phenylethylammonium (PEA+) and 2-(perfluorophenyl)ethylammonium (FEA+) moieties, revealing nanoscale phase segregation. Moreover, we illustrate the application of this structure in perovskite solar cells with power conversion efficiencies that exceed 21%, accompanied by enhanced operational stability.