Flexible electronics has attracted considerable attention owing to its enormous potential for practical applications in various fields. However, the massive strain produced during bending degrades the device. Especially at grain boundaries, due to the accumulation of defects, this degradation is exacerbated in flexible electronic devices. The importance of electrically inactivated grain boundaries increases as devices scale down to the nanoscale. Here, we propose an HfO2-x thin film that can be used as an excellent material for flexible electronics with versatile functionality, especially for grain boundary passivation. Various electrical phases of HfO2-x thin films with conducting to insulating behavior, which originates from oxygen deficiency, have been fabricated on flexible substrates. Furthermore, owing to the most stable charge state of oxygen vacancies, oxygen-deficient HfO2-x shows p-type conductivity. Current mapping by conductive atomic force microscopy reveals that current flow is hindered at grain boundaries due to the formation of potential barriers. This phenomenon is also observed in bent flexible thin films on convex and concave molds, leading to tensile and compressive strains, respectively. Although the defect concentration increases because of lattice deformation during bending, more holes are trapped at the grain boundaries, resulting in an increased hole barrier height. We believe that grain boundary passivation through hole barrier modulation during bending would pave the way for advances in hafnia-based nanoscale flexible electronics.