Nanowires and nanotubes have been the focus of considerable efforts in energy storage and solar energy conversion because of their unique properties. However, owing to the limitations of synthetic methods, most inorganic nanotubes, especially for multi-element oxides and binary-metal oxides, have been rarely fabricated. Here we design a gradient electrospinning and controlled pyrolysis method to synthesize various controllable 1D nanostructures, including mesoporous nanotubes, pea-like nanotubes and continuous nanowires. The key point of this method is the gradient distribution of low-/middle-/high-molecular-weight poly(vinyl alcohol) during the electrospinning process. This simple technique is extended to various inorganic multi-element oxides, binary-metal oxides and single-metal oxides. Among them, Li3V2(PO4)3, Na0.7Fe0.7Mn0.3O2 and Co3O4 mesoporous nanotubes exhibit ultrastable electrochemical performance when used in lithium-ion batteries, sodium-ion batteries and supercapacitors, respectively. We believe that a wide range of new materials available from our composition gradient electrospinning and pyrolysis methodology may lead to further developments in research on 1D systems.