To address shale wellbore instability and promote sustainable development in the oil and gas drilling industry, chitin nanofibers (ChNFs) were extracted from shrimp shells and employed as environmentally friendly shale inhibitors for the first time. Two types of ChNFs, namely, 2,2,6,6tetramethylpiperidinooxy (TEMPO)-mediated oxidized ChNFs (T-ChNFs) and deacetylated T-ChNFs (DT-ChNFs), were prepared through TEMPO-mediated oxidation of shrimp shell-derived chitin and partial deacetylation of obtained T-ChNFs, respectively. Due to the abundance of hydroxyl, carboxyl, and amide groups, both T-ChNFs and DT-ChNFs formed hydrogen bonds with clay particles, adsorbed on the shale surface, and thereby demonstrated superior shale inhibition capacity than the conventional shale inhibitor potassium chloride (KCl). Moreover, T-ChNFs and DT-ChNFs were capable of replacing interlayer water through intercalation, effectively inhibiting water invasion into the interlayer. DT-ChNFs with positive charges on the surface exhibited enhanced shale inhibition properties due to more effective adsorption on the shale surface through electrostatic interactions. Additionally, T-ChNFs and DT-ChNFs showed favorable compatibility with bentonite water-based drilling fluids (BT-WDFs). The addition of ChNFs significantly improved the rheological properties of the BT-WDFs without compromising their filtration properties. In contrast, the inclusion of KCl in BT-WDFs resulted in a substantial decline in filtration performance.