We present a novel algorithm called CrystalDock that analyzes a molecular pocket of interest and identifies potential binding fragments. The program first identifies groups of pocket-lining receptor residues (i.e., microenvironments) and then searches for geometrically similar microenvironments present in publically available databases of ligand-bound experimental structures. Germane fragments from the crystallographic or NMR ligands are subsequently placed within the novel binding pocket. These positioned fragments can be linked together to produce ligands that are likely to be potent; alternatively, they can be joined to an inhibitor with a known or suspected binding pose to potentially improve binding affinity. To demonstrate the utility of the algorithm, CrystalDock is used to analyze the principal binding pockets of influenza neuraminidase and Trypanosoma brucei RNA editing ligase 1, validated drug targets in the fight against pandemic influenza and African sleeping sickness, respectively. In both cases, CrystalDock suggests modifications to known inhibitors that may improve binding affinity.