A series of heterocyclic compounds were synthesized and fully characterized. The geometry optimization was carried out using the Density Functional Theory (DFT) method and the electronic properties of 1-(2-hydroxyethyl)-3-(2-(piperidinium-1-yl)ethyl chloride)-1H-benzo[d]imidazol-3-ium bromide and 1-(2-methylbenzyl)-3-(2-(piperidinium-1-yl)ethyl)-1H-benzo[d]imidazol-3-ium dichloride were calculated. Furthermore, the all compounds were evaluated for their potential anticancer activity towards different human cell lines. While 1-(naphthalen-1-ylmethyl)-3-(2-(piperidin-1-yl)ethyl)-1H-benzo[d]imidazol-3-ium chloride possessing naphthalen-1-ylmethyl group as substituent demonstrated important cytotoxic activity against human colorectal adenocarcinoma epithelial colon cell line (DLD-1) with an IC50 value of 15.56 +/- 4.01M, compound containing 4-methylbenzyl group showed the most anticancer activity towards human liver epithelial hepatocellular carcinoma cell line (HepG2) with IC50 value of 15.16M. Moreover, microscopic examination of cells was done using Leica inverted microscopy and Olympus confocal microscope. Confocal images of DLD-1 and human normal epithelial virus transformed cell line (Beas-2B), which were treated with 20M of compounds, indicated that compounds 1-(4-methylbenzyl)-3-(2-(piperidinium-1-yl)ethyl)-1H-benzo[d]imidazol-3-ium dichloride and 1-(naphthalen-1-ylmethyl)-3-(2-(piperidin-1-yl)ethyl)-1H-benzo[d]imidazol-3-ium chloride had more cytotoxic activity.