Cancer treatment has been revolutionized by immune checkpoint inhibitors, which regulate immune cell function by blocking the interactions between immune checkpoint molecules and their ligands. The interaction between programmed cell death-1 (PD-1) and programmed cell death-ligand 1 (PD-L1) is a target for immune checkpoint inhibitors. Nanobodies, which are recombinant variable domains of heavy-chain-only antibodies, can replace existing immune checkpoint inhibitors, such as anti-PD-1 or anti-PD-L1 conventional antibodies. However, the screening process for high-affinity nanobodies is laborious and time-consuming. Here, we identified high-affinity anti-PD-1 nanobodies using peptide barcoding, which enabled reliable and efficient screening by distinguishing each nanobody with a peptide barcode that was genetically appended to each nanobody. We prepared a peptide-barcoded nanobody (PBNb) library with thousands of variants. Three high-affinity PBNbs were identified from the PBNb library by quantifying the peptide barcodes derived from high-affinity PBNbs. Furthermore, these three PBNbs neutralized the interaction between PD-1 and PD-L1. Our results demonstrate the utility of peptide barcoding and the resulting nanobodies can be used as experimental tools and antitumor agents. Peptide barcoding can be used to screen for molecules other than nanobodies. Our methods, such as the design of peptide barcodes, the design of peptide-barcoded molecules, preparation of peptide-barcoded molecule library, and quantification of peptide barcodes, are helpful in screening for peptide-barcoded molecules.