Carboxylesterase (CE) localized in the lumen of the endoplasmic reticulum (ER) hydrolyzes many prodrugs to exert therapeutic effect, such as anticoagulant clopidogrel and anticarcinogen irinotecan. Diabetes might induce CE to show a decreasing level, and thus impact the therapy effect. Hence, it is crucial to monitor the change of CE in treatment for diabetes for using drug rationally. We attempted to develop novel near-infrared fluorescent probes to detect CE activity in the ER with high selectivity and sensitivity in cells and in vivo, and help to guide the use of CE-related medications. Moreover, the excellent chemodosimeter (Hecy-1) could be applied in detecting CE level in tumor cells and LO2 cells. In glucose-induced CE changes of LO2 cells, Hecy-1 still showed admirable imaging ability. This research may further promote the study of intracellular fine biological activities of CE and the development of diabetes diagnosis.