The synthesis and characterization ofpH-sensitive boron and nitrogen co-doped CDs (B, N-CDs) is reported. The fluorescence of B, N-CDs exhibited pH-responsive behavior within the range pH3.0-6.0, attributed to their controlled aggregation and disaggregation. Interestingly, the fluorescence of B, N-CDs was quenched by the inner filter effect from chrome azurol S (CAS). With the subsequent addition of Al3+, the fluorescence of B, N-CDs was restored due to the formation of blue Al3+-CAS and B, N-CDs-Al3+ complexes. Consequently, a fluorescent and colorimetric dual-mode sensor for Al3+ detection was developed. The proposed sensor enabled Al3+ detection in the ranges and limits of detection of 3.75-22.5μM and 2.67μM for the fluorescent mode and 5-20μM and 4.8μM for the colorimetric mode, respectively. Furthermore, the efficacy of the sensor was validated through successful detection of Al3+ in tablet samples. The obtained B, N-CDs promised the application in acid condition and the proposed sensor isexpected tobe applied toin situ on-line detection of Al3+.