Environmentally friendly tin (Sn)-based metallic halide perovskites suffer from oxidation and morphological issues. Here, we demonstrate the composition engineering of Pb-Sn-alloyed two-dimensional (2D) Ruddlesden-Popper perovskites, (BA)(MA)PbSn I, for efficient and stable solar cell applications. Smooth thin films with high surface coverage are readily formed without using any additive owing to the self-assembly characteristic of 2D perovskites. It is found that Sn plays a significant role in improving the crystallization and crystal orientation while narrowing the bandgap of Pb-Sn 2D perovskites. Photophysical studies further reveal that the optimal Sn ratio (25 mol %) based sample exhibits both minimized trap density and weakened quantum confinement for efficient charge separation. Consequently, the optimized (BA)(MA)PbSnI-based solar cells yield the best power conversion efficiency close to 6% with suppressed hysteresis.