Pitaya fruit (Hylocereus spp.) is rich in bioactive compounds such as betanin. This study aimed to extract betanin-rich pitaya fruit and encapsulate it in electrospun nanofibers produced with sweet potato starch. The influence of different concentrations of this bioactive compound on the morphology, functional groups, hydrophilicity, load capacity, color, thermal properties, and contact angle of the electrospun nanofibers with water and milk was assessed. The potential antioxidant and stability of nanofibers during gastrointestinal digestion in vitro were demonstrated. The nanofibers presented average diameters ranging from 134 to 204 nm and displayed homogeneous morphology. The load capacity of the extract in the nanofibers was 43% to 83%. The encapsulation increased the thermal resistance of betanins (197-297 °C). The static contact angle with water and milk showed that these materials presented greater affinity with milk. Principal component analysis (PCA) and hierarchical cluster analysis (HCA) showed that the nanofibers with 5%, 25%, and 45% pitaya extract presented unique characteristics. They showed resistance in delivering betanins to the stomach, with 12% inhibition of the 2,2-diphenyl-1-picrylhydrazyl (DPPH˙) radical. However, only the 45% concentration reached the intestine with 9.83% inhibition of the DPPH˙ radical. Pattern recognition from multivariate analyses indicated that nanofibers containing 5%, 25%, and 45% of the extract presented distinct characteristics, with the ability to preserve betanins against thermal degradation and perform the controlled delivery of these bioactives in the stomach and intestine to produce antioxidant activity. © 2024 Society of Chemical Industry.