One-dimensional (1D) carbon nanostructures have been intensively investigated because of their intriguing features and great potential for practical application in various fields. This paper reports the controllable fabrication of carbon hollow nanobubbles on porous carbon nanofibers (CHNBs@PCNFs) through a general electrospinning strategy, with metal azides serving as both a bubbling and a porogen reagent. The strong repulsive forces resulting from the intense release of N 2 from the decomposition of metal azides upon carbonization leads to the uniform formation of porous carbon nanofibers (PCNFs), which could be facile tuned by heating rates and the amount of the bubbling reagent, simultaneously constructed with carbon hollow nanobubbles (CHNBs) on the surface. Density functional theory calculations reveal the strong interactions between terminal Na atoms in sodium polysulfides and N and O atoms doped into CHNBs@PCNFs, which could effectively alleviate the shuttle effect of Na-S batteries via adsorbing and trapping polysulfides. With strong adsorption capability of sodium polysulfides and high electrical conductivity, these CHNBs@PCNFs are demonstrated to be an ideal sulfur host in room-temperature sodium-sulfur batteries, which delivers a high reversible capacity of 256 mA h g −1 (specific energy density 384 W h kg −1 ) with a low decay rate of 0.044% per cycle at 2 C-rate. When CHNBs@PCNFs used as functional supports for MgH 2 nanoparticles, a significantly enhanced hydrogen storage performance was achieved. The present work represents a critically important step in advancing the electrospinning technique for generating 1D carbon nanostructures in a facile and universal manner.