A freestanding γ-Fe2O3/carbon nanofiber composite as the anode of lithium ion batteries has been prepared with γ-Fe2O3 nanoparticles aligned in the tubular channels of the nanofibrous carbon matrix. Innovatively, a large amount of voids are generated for confining a very high active mass content by facilely verifying the ratio of carbon source and the sacrificing pore-forming agent, poly(methyl methacrylate). The best electrochemical performance at an active mass ratio of 70% is obtained with a high discharge capacity of 1088 mAh g−1 retained after 300 cycles at 0.2 C. Good rate capability and long life-span performance are further achieved at 0.5 and 2 C for 600 and 1000 cycles, respectively. In situ X-ray patterns further reveal better exploitation of the active materials for this γ-Fe2O3/carbon nanofiber composite electrode. The enhanced electrochemical performance of lithium ion batteries can be ascribed to the well-dispersed γ-Fe2O3 nanoparticles within the porous carbon matrix, as well as the cross-linked fiber morphology. Consequently, this study provides a superior electrode architecture for constructing flexible anodes of high-performance lithium ion batteries.