Theory predicts that periodic photonic nanostructures should outperform their random counterparts in trapping light in solar cells. However, the current certified world-record conversion efficiency for amorphous silicon thin-film solar cells, which strongly rely on light trapping, was achieved on the random pyramidal morphology of transparent zinc oxide electrodes. Based on insights from waveguide theory, we develop tailored periodic arrays of nanocavities on glass fabricated by nanosphere lithography, which enable a cell with a remarkable short-circuit current density of 17.1 mA/cm(2) and a high initial efficiency of 10.9%. A direct comparison with a cell deposited on the random pyramidal morphology of state-of-the-art zinc oxide electrodes, replicated onto glass using nanoimprint lithography, demonstrates unambiguously that periodic structures rival random textures.