Multifunctional living materials are attractive due to their powerful ability to self-repair and replicate. However, most natural materials lack electronic functionality. Here we show that an electric field, applied to electricity-producing Geobacter sulfurreducens biofilms, stimulates production of cytochrome OmcZ nanowires with 1,000-fold higher conductivity (30 S cm-1) and threefold higher stiffness (1.5 GPa) than the cytochrome OmcS nanowires that are important in natural environments. Using chemical imaging-based multimodal nanospectroscopy, we correlate protein structure with function and observe pH-induced conformational switching to β-sheets in individual nanowires, which increases their stiffness and conductivity by 100-fold due to enhanced π-stacking of heme groups; this was further confirmed by computational modeling and bulk spectroscopic studies. These nanowires can transduce mechanical and chemical stimuli into electrical signals to perform sensing, synthesis and energy production. These findings of biologically produced, highly conductive protein nanowires may help to guide the development of seamless, bidirectional interfaces between biological and electronic systems.