Biotemplated synthesis of functional nanomaterials has received increasing attention for applications in energy, catalysis, bioimaging, and other technologies. This approach is justified by the unique abilities of biological systems to guide sophisticated assembly and organization of molecules and materials into distinctive nanoscale morphologies that exhibit physicochemical properties highly desirable for specific purposes. Here, we present a high-performance, flexible nanogenerator using anisotropic BaTiO3 (BTO) nanocrystals synthesized on an M13 viral template through the genetically programmed self-assembly of metal ion precursors. The filamentous viral template realizes the formation of a highly entangled, well-dispersed network of anisotropic BTO nanostructures with high crystallinity and piezoelectricity. Even without the use of additional structural stabilizers, our virus-enabled flexible nanogenerator exhibits a high electrical output up to similar to 300 nA and similar to 6 V, indicating the importance of nanoscale structures for device performances. This study shows the biotemplating approach as a facile method to design and fabricate nanoscale materials particularly suitable for flexible energy harvesting applications.