It was found that 5,10,15,20-tetrakis(4-sulfonatophenyl)porphyrin (TPPS), which is known to aggregate in a one-dimensional fashion in water, acts as a template for the electropolymerization of aniline on an ITO electrode. Examinations using cyclic voltammetry (CV) and UV-vis spectroscopy established that J-aggregated TPPS molecules are entrapped in the resultant poly(aniline). Scanning electron microscopy (SEM) observations established that poly(aniline) grows to a nanosized rod-like structure, reflecting the aggregation structure of TPPS. The chemical oxidative polymerization of aniline in the presence of TPPS also gave a poly(aniline) rod-like structure containing the TPPS J-aggregate. It was found that the J-aggregation mode in the poly(aniline)/TPPS composite disappears when the medium pH is shifted from acidic to basic, but is regenerated when the medium pH is shifted from basic to acidic. This interconversion could be visually recognized by changes in the color and the fluorescence intensity.