Two viologen complexes containing N,N′-bis(carboxyethyl)-4,4′-bipyridinium (BCEbpy) were prepared, namely [Zn(H2O)6]·(BCEbpy)·(p-BDC)·3H2O (1) and [Co(H2O)6]·(BCEbpy)·(p-BDC)·3H2O (2) (p-H2BDC = 1,4-benzenedicarboxylic acid), and their crystal structures, photochromism, frontier molecular orbitals, Hirshfeld surfaces and 2D fingerprint plots were investigated. The modulation effects of pi–pi interactions were explored on the electronic and photochromic properties of compounds 1 and 2. Due to the existence of photo-response viologen radicals, both complexes 1 and 2 display excellent photo-response properties in the sequence 1 < 2. The results indicate that compound 1 exhibits intramolecular electron transfer; compound 2 exhibits both intramolecular and intermolecular electron transfer, which is mainly due to the change of electronic and steric structures caused by pi–pi interactions with a faster photo-response rate than that of compound 1. The donor–acceptor modes, matching principles and inter/intramolecular atom–atom close contacts were illustrated by the density functional theory (DFT)-B3LYP/6-311(d,p) method.