Abstract A novel, sustainable composite film (CS-SN–CQDs)was fabricated by integrating sulfur and nitrogen co-doped carbon quantum dots (SN–CQDs) prepared from red onion peels (RO) with cellulose sulfate (CS) derived from sugarcane bagasse (SCB). The purpose of this study was to develop a multimodal sensor and antimicrobial material from these agrowastes for food safety applications. The structural and electronic properties of the CS film, SN–CQDs, and the resulting composite were investigated using density functional theory (DFT) calculations and Fourier transform infrared spectroscopy (FTIR). DFT analysis revealed a significantly reduced energy gap (0.03078 eV) and lower total energy (–2620.89 au) for the CS-SN–CQDs composite, indicating enhanced charge transfer and thermodynamic stability. FTIR confirmed the successful incorporation of SN–CQDs within the CS matrix and demonstrated an increase in hydrogen bonding strength. The CS-SN–CQDs film exhibited significantly enhanced antibacterial activity against Escherichia coli (99.45%), Staphylococcus aureus (86.24%), and Candida (96.41%) compared to the CS film. Molecular docking studies supported these findings by showing stronger binding interactions of the composite with key microbial proteins. Furthermore, the film demonstrated multimodal sensing capabilities, acting as a fluorescent probe for the visual detection of bacteria, fungi, and Cr(VI) contamination (via fluorescence quenching), and as a naked-eye pH sensor, transitioning from yellow to red, and showed a distinct color transformation to bright brown upon exposure to Cr(VI) and the byproducts of green bean spoilage. The developed CS-SN–CQDs film, therefore, shows exceptional promise for sustainable and rapid food quality and environmental monitoring applications.