In contrast to standard fragment-based drug discovery approaches, dual-display DNA-encoded chemical libraries have the potential to identify fragment pairs that bind simultaneously and benefit from the chelate effect. However, the technology has been limited by the difficulty in unambiguously decoding the ligand pairs from large combinatorial libraries. Here we report a strategy that overcomes this limitation and enables the efficient identification of ligand pairs that bind to a target protein. Small organic molecules were conjugated to the 5' and 3' ends of complementary DNA strands that contain a unique identifying code. DNA hybridization followed by an inter-strand code-transfer created a stable dual-display DNA-encoded chemical library of 111,100 members. Using this approach we report the discovery of a low micromolar binder to alpha-1-acid glycoprotein and the affinity maturation of a ligand to carbonic anhydrase IX, an established marker of renal cell carcinoma. The newly discovered subnanomolar carbonic anhydrase IX binder dramatically improved tumour targeting performance in vivo.