A new computer program has been developed to automatically obtain the relative position of two molecules in which the similarity between molecular electrostatic-potential distributions is greatest. These distributions are considered in a volume around the molecules, and the similarity is measured by the Spearman rank coefficient. The program has been tested using several pairs of molecules: water vs. water; phenylethylamine and phenylpropylamine vs. benzylamine; and methotrexate vs. dihydrofolic acid.