Salivary pepsin has emerged as a promising biomarker for rapid screening and diagnosis of gastroesophageal reflux disease (GERD). Pepsin mainly exists in strongly acidic environments and exhibits its highest activity. However, the poor stability of most fluorescent sensors in strong acidic environments brings a significant challenge for pepsin detection. Herein, an innovative biosensor was developed for the highly specific and sensitive detection of pepsin on the basis of green-emitting ionic liquid-based carbon dots (G-IL-CDs) conjugated with whey proteins (WPs). The G-IL-CDs exhibited aggregation-induced fluorescence enhancement when interacting with WP, and the fluorescence intensity decreased after incubation with pepsin due to the disruption of the aggregation structure. This strategy is highly selective for pepsin due to the strongly acidic environment in which other proteases are inactivated. Under optimal experimental conditions, this biosensor successfully detected pepsin in real human saliva with a satisfying recovery. Furthermore, this study not only developed a CDs-based sensor for detecting pepsin but also laid a solid theoretical foundation for the future development of novel biosensors combining CDs and proteins.