One common practice in drug discovery is to optimize known or suspected ligands in order to improve binding affinity. In performing these optimizations, it is useful to look at as many known inhibitors as possible for guidance. Medicinal chemists often seek to improve potency by altering certain chemical moieties of known/endogenous ligands while retaining those critical for binding. To our knowledge, no automated, ligand-based algorithm exists for systematically ‘swapping’ the chemical moieties of known ligands to generate novel ligands with potentially improved potency. To address this need, we have created a novel algorithm called ‘LigMerge’. LigMerge identifies the maximum (largest) common substructure of two three-dimensional ligand models, superimposes these two substructures, and then systematically mixes and matches the distinct fragments attached to the common substructure at each common atom, thereby generating multiple compound models related to the known inhibitors that can be evaluated using computer docking prior to synthesis and experimental testing. To demonstrate the utility of LigMerge, we identify compounds predicted to inhibit peroxisome proliferator–activated receptor gamma, HIV reverse transcriptase, and dihydrofolate reductase with affinities higher than those of known ligands. We hope that LigMerge will be a helpful tool for the drug design community.