One three-dimensional quantitative structure-activity relationship (3D-QSAR) model and one three-dimensional quantitative structure-selectivity relationship (3D-QSSR) model using Topomer CoMFA method were implemented on benzimidazole and imidazole inhibitors of Histone deacetylase 2 (HDAC2). Good cross-validated correlations were obtained in 3D-QSAR model (resulting in q2 value of 0.756 and r2 value of 0.947) and 3D-QSSR model (resulting in q2 value of 0.779 and r2 value of 0.912). Both of the models were validated by the test set, which gave a satisfactory r2pred value of 0.697 and 0.891, respectively. The results lead to better understanding of the structural requirements of both HDAC2 inhibitory activity and selectivity. The models can also be used for virtual screening.