Polyaniline hollow nanofibers (PANI-HNFs) are successfully synthesized by using poly (methyl methacrylate) nanofibers as a sacrifice-template via an in-situ polymerization with a subsequent dissolution process. The polyaniline hollow nanofibers as cathode material for sodium-ion batteries exhibit a high reversible capacity of 153 mA h g−1 at 0.3 C (1C = 150 mA g−1), high cycling stability (73.3% capacity retention after 1000 cycles) and rate capability (70 mA h g−1 at 8 C). The high electrochemical performance of the polyaniline hollow nanofibers originates from the one dimension hollow nanostructures with unique morphologies and highly reversible doping/dedoping property of the conducting polymer, so as to ensure well structural stability and good electrical/ionic conducting connectivity. Furthermore, this strategy can controllably prepare various hollow one dimension structures with different tube diameters and wall sizes, which has potential application for energy storage materials, catalysts, drug-delivered materials and chemical microreactors.