Very large combinatorial libraries of small molecules on solid supports can now be synthesized and each library element can be identified after synthesis by using chemical tags. These tag-encoded libraries are potentially useful in drug discovery, and, to test this utility directly, we have targeted carbonic anhydrase (carbonate dehydratase; carbonate hydro-lyase, EC 4.2.1.1) as a model. Two libraries consisting of a total of 7870 members were synthesized, and structure-activity relationships based on the structures predicted by the tags were derived. Subsequently, an active representative of each library was resynthesized (2-[N-(4-sulfamoylbenzoyl)-4'-aminocyclohexanespiro]-4-oxo-7 -hydroxy- 2,3-dihydrobenzopyran and [N-(4-sulfamoylbenzoyl)-L-leucyl]piperidine-3-carboxylic acid) and these compounds were shown to have nanomolar dissociation constants (15 and 4 nM, respectively). In addition, a focused sublibrary of 217 sulfamoylbenzamides was synthesized and revealed a clear, testable structure-activity relationship describing isozyme-selective carbonic anhydrase inhibitors.