An electrospun nanofiber mat was prepared based on polyvinyl acohol and a natural pigment from red cabbage (Brassica oleracea L.) extract (RCE) to function as a pH biosensor. Morphological properties of the nanofiber mats were characterized using scanning electron microscopy and the chemical structure was studied using FTIR. The pH sensitivity of the nanofibers was tested using a series of different pH solutions and the color spectrum of nanofiber mats at different pH values were calibrated using a colorimeter. Results showed that the designed mat could be used as a pH sensor and indicate pH values in the 2–12 range. The mat colors were reversible according to the changing pH value and hence transient changes could be monitored. Trials on fresh date fruit (Rutab) demonstrated that the pH mat responses correlated well with pH changes in packaged dates, thus enabling real-time monitoring of pH-linked changes within the package.