Abstract This study aimed to develop and characterize a non-contact pH-responsive nanofibrous indicator based on polyacrylonitrile (PAN) and Malva sylvestris extract (MFE) for smart food packaging applications. Initially, nanofibers were fabricated using three PAN concentrations (10%, 13%, and 16% w/v), and 13% PAN was selected as the optimal matrix based on morphological and mechanical evaluations. Anthocyanin-rich MFE was then incorporated into the optimized PAN solution at three loadings (10%, 20%, and 30% w/w) to obtain multifunctional colorimetric nanofibers. FTIR and XRD analyses confirmed hydrogen bonding and π–π interactions between PAN nitrile groups and phenolic compounds of MFE, leading to reduced crystallinity and improved molecular cohesion. The PAN/MFE II formulation (20% extract) exhibited the best balance of properties, including high tensile strength (9.36 MPa), thermal stability, and antioxidant activity (47.7% DPPH inhibition). The films showed distinct and reversible color transitions, from pink (pH 2) to purple (pH 7), green (pH 9), and yellow (pH 12), reflecting anthocyanin structural transformations. The nanosensor’s practical performance was evaluated in fish ( Otolithes ruber ) packaging under non-contact conditions. During refrigerated storage, color changes of the sensor strongly correlated with increases in fish pH and total volatile basic nitrogen (TVB-N), successfully indicating both early spoilage and full deterioration stages. These findings demonstrate that the PAN/MFE nanofibrous system offers a safe, stable, and sensitive non-contact optical indicator suitable for next-generation intelligent food packaging.