Wastewater sludge has become a major environmental and social problem for many cities. Biorefinery technology converts waste sludge into fibrous materials, such as the hyphae fibers shown in this image, through thermal hydrolysis followed by fungal fermentation. Waste organics in the sludge are released into the liquid phase by means of thermal hydrolysis, and the dissolved organics are further synthesized into valuable hyphae fibers through fermentation by the filamentous fungus Aspergillus niger. Hyphae fibers are then self-assembled to form mycelium pellets that can be readily recovered. As high-quality fibrous materials, hyphae fibers can be used for making paper sheets and as packing and filling materials. These biofibers can also be utilized as an ideal carbon source to produce heteroatom-doped carbon materials for applications in batteries, supercapacitors, fuel cells, and hydrogen storage. Thus, biorefinery technology holds attractive potential for the bioconversion of a wide range of organic wastes via fungal fermentation into valuable biomass-based materials such as hyphae fibers.