We demonstrate four- and two-terminal perovskite-perovskite tandem solar cells with ideally matched band gaps. We develop an infrared-absorbing 1.2-electron volt band-gap perovskite, FA0.75Cs0.25Sn0.5Pb0.5I3, that can deliver 14.8% efficiency. By combining this material with a wider-band gap FA0.83Cs0.17Pb(I0.5Br0.5)3 material, we achieve monolithic two-terminal tandem efficiencies of 17.0% with >1.65-volt open-circuit voltage. We also make mechanically stacked four-terminal tandem cells and obtain 20.3% efficiency. Notably, we find that our infrared-absorbing perovskite cells exhibit excellent thermal and atmospheric stability, not previously achieved for Sn-based perovskites. This device architecture and materials set will enable “all-perovskite” thin-film solar cells to reach the highest efficiencies in the long term at the lowest costs.