We propose a novel approach to disperse and extract small-diameter single-walled carbon nanotubes (SWCNTs) using an aqueous solution of riboflavin and Sephacryl gel. The extraction of small-diameter semiconducting SWCNTs was observed, regardless of the initial diameter distribution of the SWCNTs. Dispersion of SWCNTs occurs due to the adsorption of π-conjugated isoalloxazine moieties on the surface of small-diameter nanotubes and interactions between hydroxy groups of ribityl chains with water. During the SWCNT extraction, specific adsorption of riboflavin to SWCNTs leads to the minimization of interactions between the SWCNTs and gel media. Our experimental findings are supported by ab initio calculations demonstrating the impact of the riboflavin wrapping pattern around the SWCNTs on their interaction with the allyl dextran gel.