Hydrogen sulfide (H 2 S), emerging as an important gaseous signal, has attracted more and more attention for its key role in chronic fatty liver diseases. However, lacking tools for H 2 S-specific in situ detection, the changes of endogenous hepatic H 2 S levels in the pathological progression of chronic liver diseases are still unclear. To this end, we adopted a strategy of combining molecular probe design and nanofunctionalization to develop a highly selective near-infrared (NIR) fluorescent probe, which allows in vivo realtime monitoring of hepatic H 2 S levels in the process of nonalcoholic fatty liver disease (NAFLD). As a proof of strategy demonstration, we first designed NIR molecular probes for H 2 S sensing through chemical design and probe screening and then loaded molecular probes into mesoporous silicon nanomaterials (MSNs) with surface encapsulation using poly(ethylene glycol) to construct a highly selective probe MSN@CSN@PEG, with significantly improved selectivity and photostability. Moreover, MSN@CSN@PEG exhibited high selectivity and sensitivity for endogenous H 2 S in cells and tumors in vivo, eliminating the interference of a high concentration of biothiols and sulfhydryl proteins. Furthermore, the probe was applied to in situ intravital imaging and systematic assessment of hepatic H 2 S levels in different stages of NAFLD for the first time, which may offer a promising tool for the future study of fatty liver diseases and other chronic liver diseases.