The development of rapid and reliable techniques for detecting pathogenic bacterial strains is of utmost importance in ensuring food security and safeguarding public health. This study presents a novel approach to fabricating highly fluorescent Carbon dots (CDs) through a facile one-step thermal calcination method, utilizing disposable face masks as the exclusive carbon source. The developed CDs demonstrated excellent fluorescence stability, excitation-dependent emission and particle sizes ranging from 4 - 10 nm. The developed CDs demonstrated efficient fluorescence quenching upon interaction with Escherichia coli (E. coli) and Staphylococcus aureus (S. aureus), attributed to the robust bonding between the bacterial species and the CD surface. This unique property positions the CDs as functional sensors for the detection of specific bacterial strains. The sensor displayed an impressive limit of detection, reaching as low as 8 CFU/ml for E. coli and 9 CFU/ml for S. aureus. Furthermore, the synthesized CDs were integrated into a polyvinyl alcohol (PVA) matrix to fabricate PVA@CDs films. These films inherited the distinctive optical characteristics of fluorescent CDs, resulting in intense cyan fluorescence emission, high visible transparency, and an exceptional approximately 100% ultraviolet (UV) rays-blocking ratio in the UV region. This multifaceted approach not only addresses the urgent need for effective pathogenic bacterial detection but also extends the application of CDs to UV-blocking films with potential implications for various fields, including healthcare and environmental safety.