The mass production of precise three-dimensional (3D) nanopatterns has long been the ultimate goal of fabrication technology. While interference lithography and proximity-field nanopatterning (PnP) may provide partial solutions, their setup complexity and limited range of realizable structures, respectively, remain the main problems. Here, we tackle these challenges by applying an inverse design to the PnP process. Our inverse design platform based on the adjoint method can efficiently find optimal phase masks for diverse target lattices and motifs. We fabricate a 2D rectangular array of nanochannels, which has not been reported for conventional PnP with normally incident light, as a proof of concept. With further demonstration of material conversion, our work provides versatile platforms for nanomaterial fabrication.