In this study, we successfully synthesized self-nitrogen-doped carbon dots (N-CDs) from shrimp shells (waste biomass) via a hydrothermal process for tetracycline (TC) residue analysis in food. They exhibited excellent photostability, low toxicity, and a high fluorescence quantum yield (QY) of 9.72 %. Owing to the internal filtration effect (IFE) and static quenching effect (SQE), the fluorescence emission intensity of the N-CDs-based probe exhibited a marked decline concomitant with the augmentation of TC concentration. Under optimal circumstances, there was a robust linear relationship between the TC concentration (0-60 mu M) and the system's degree of fluorescence quenching ((F0-F)/F0), with a low detection limit of 96 nM. The developed fluorescent probe was effectively applied to detect TC in milk and egg samples, achieving a relative standard deviation from 1.4 % to 3.2 % and recoveries from 98.2 % to 109.7 %, comparable to the standard high-performance liquid chromatography (HPLC) method. In conclusion, shrimp shell-derived N-CDs hold great potential as fluorescent probes for highly sensitive, selective, accurate and real-time TC detection, which is important in ensuring food safety.