Abstract Background Halogen bonding has recently come to play as a target for lead optimization in rational drug design. However, most docking program don’t account for halogen bonding in their scoring functions and are not able to utilize this new approach. In this study a new and improved halogen bonding scoring function (XBSF) is presented along with its implementation in the AutoDock Vina molecular docking software. This new improved program is termed as AutoDock VinaXB, where XB stands for the halogen bonding parameters that were added. Results XBSF scoring function is derived based on the X···A distance and C–X···A angle of interacting atoms. The distance term was further corrected to account for the polar flattening effect of halogens. A total of 106 protein-halogenated ligand complexes were tested and compared in terms of binding affinity and docking poses using Vina and VinaXB. VinaXB performed superior to Vina in the majority of instances. VinaXB was closer to native pose both above and below 2 Å deviation categories almost twice as frequently as Vina. Conclusions Implementation of XBSF into AutoDock Vina has been shown to improve the accuracy of the docking result with regards to halogenated ligands. AutoDock VinaXB addresses the issues of halogen bonds that were previously being scored unfavorably due to repulsion factors, thus effectively lowering the output RMSD values.