Hierarchical porous cobalt oxide (Co3O4) array films are successfully prepared by electrodeposition through polystyrene sphere monolayer template. The as-prepared Co3O4 array films exhibit three typical porous structures from non-close-packed bowl array to close-packed bowl array and hierarchical two layer array structures. These Co3O4 array films have a hierarchical porous structure, in which the skeleton is composed of ordered arrays possessing nanoporous walls. A possible growth mechanism of porous Co3O4 array films is proposed. As anodes for Li ion batteries, the as-prepared Co3O4 array films exhibit quite good cycle life and high capacity. The first discharge capacity for the three Co3O4 array films is 1511, 1475, 1463mAhg−1, respectively, and their initial coulombic efficiencies are as high as 72%. The specific capacity after 50 cycles for the three electrodes is 712, 665 and 640mAhg−1 at 1C rate, corresponding to 80%, 75%, 72% of the theoretical value (890mAhg−1), respectively.