Controllable CdS nanoparticles (NPs) decorated on TiO2 nanotube arrays (NTAs) were prepared via electrodeposition in DMSO solution at room temperature, aiming to improve the photoelectrochemical properties of TiO2 NTA electrode in visible-light region. By tuning the concentrations of sulfur and Cd2+ as well as the deposition time, CdS NPs with different sizes can be controllably synthesized at room temperature. Excellent photocurrent response and incident photo to current conversion efficiency were achieved with smaller CdS NPs with optimal reactant concentrations and deposition time, which can be attributed to highly efficient charge separation and high dispersion of CdS NPs on both inner and outer surfaces of TiO2 nanotubes.