Monodisperse silver nanoparticles with different sizes were synthesized by electrochemical reduction inside or outside zeolite crystals according to the silver exchange degree of compact zeolite film modified electrodes.