Flexible electrodes attract significant attention to meet increasing demands for flexible power sources but are held back from practical applications owing to its their heavy weight and poor electrochemical performance. Herein, a robust three-dimensional (3D) flexible and light reduced graphene oxide modified N-doped carbon foam-TiO2 (NCF@rGO-TiO2) electrode is constructed by using a flexible and light (2.2 mg cm−2) NCF@rGO matrix to support TiO2. The electrode has a 3D high conductivity network, large specific surface area, abundant pore structure, and nano-sized active material, which is are highly conductive to improve electrochemical kinetics of the TiO2. Hence, the flexible electrode shows high rate performances (lithium ion batteries (LIBs): 334 and 134 mAh g−1 at 0.1 and 20 C; sodium ion batteries (SIBs): 305 and 120 mAh g−1 at 0.5 and 10 C). Uniting the robust structure of the NCF@rGO skeleton and the small volume change of the TiO2 in electrochemical reaction, the flexible electrode also exhibits good cycling performances for LIBs (82.7% capacity retention after 3000 cycles at 10 C) and SIBs (nearly 100% capacity retention after 70 cycles at 5 C). And, a soft-packaged battery can run well in any bend states, thus offering an attractive vista toward flexible power sources.