Nanopatterning has gained tremendous importance in the field of photovoltaics, as absorption of sunlight in solar cells can be enhanced drastically by proper engineering of photonic nanostructures1– 8. However, despite intensive efforts, neither the ideal surface morphology nor the ideal scattering characteristics foroptimumlight trapping have been identified. Experimentally, a method capable of implementing arbitrarily designed surface morphologies directly into functional devices is desirable. Here, we establish a nanomoulding process that provides exactly such a platform, enabling precise, large-area, nanoscale patterning of functional zinc oxide films at low cost. We illustrate the application of nanomoulded zinc oxide films as transparent front electrodes in amorphous silicon solar cells, demonstrating excellent initial conversion efficiencies of 10.1%. In the quest to find the most efficient light-harvesting scheme, we anticipate that nanomoulding will catalyse the development and integration of exciting new nanophotonic structures.