The massive conversion of resourceful biomass to carbon nanomaterials not only opens a new avenue to effective and economical disposal of biomass, but provides a possibility to produce highly valued functionalized carbon-based electrodes for energy storage and conversion systems. In this work, biomass is applied to a facile and scalable one-step pyrolysis method to prepare three-dimensional (3D) carbon nanotubes/mesoporous carbon architecture, which uses transition metal inorganic salts and melamine as initial precursors. The role of each employed component is investigated, and the electrochemical performance of the attained product is explored. Each component and precise regulation of their dosage is proven to be the key to successful conversion of biomass to the desired carbon nanomaterials. Owing to the unique 3D architecture and integration of individual merits of carbon nanotubes and mesoporous carbon, the as-synthesized carbon nanotubes/mesoporous carbon hybrid exhibits versatile application toward lithium-ion batteries and Zn-air batteries. Apparently, a significant guidance on effective conversion of biomass to functionalized carbon nanomaterials can be shown by this work.