Single-crystalline ZnO nanowire arrays with different aspect ratios and nanowire densities were prepared by the hydrothermal growing method using polyethyleneimine (PEI) as a surfactant. PEI can only hinder the lateral growth of the ZnO nanowires, which is observed by high resolution transmission electron microscopy (HRTEM) analysis. Dye-sensitized solar cells were assembled by the ZnO nanowire arrays with different thicknesses, which can be controlled by the growing time and characterized using photocurrent-voltage measurements. Their photocurrent densities and energy allover conversion efficiencies increased with increasing ZnO nanowire lengths. Short-circuit current density of 4.31 mA.cm-2 and allover energy conversion efficiency of 0.87% were achieved with 12.9-μm-long ZnO nanowire arrays.