Abnormal H2O2 levels are closely related to many diseases, including inflammation and cancers. Herein, we simultaneously load HRP and its substrate, 2,2'-azino-bis(3-ethylbenzothiazoline-6-sulfonic acid) (ABTS), into liposomal nanoparticles, obtaining a Lipo@HRP&ABTS optical nanoprobe for in vivo H2O2-responsive chromogenic assay with great specificity and sensitivity. In the presence of H2O2, colorless ABTS would be converted by HRP into the oxidized form with strong near-infrared (NIR) absorbance, enabling photoacoustic detection of H2O2 down to submicromolar concentrations. Using Lipo@HRP&ABTS as an H2O2-responsive nanoprobe, we could accurately detect the inflammation processes induced by LPS or bacterial infection in which H2O2 is generated. Meanwhile, upon systemic administration of this nanoprobe we realize in vivo photoacoustic imaging of small s.c. tumors (∼2 mm in size) as well as orthotopic brain gliomas, by detecting H2O2 produced by tumor cells. Interestingly, local injection of Lipo@HRP&ABTS further enables differentiation of metastatic lymph nodes from those nonmetastatic ones, based on their difference in H2O2 contents. Moreover, using the H2O2-dependent strong NIR absorbance of Lipo@HRP&ABTS, tumor-specific photothermal therapy is also achieved. This work thus develops a sensitive H2O2-responsive optical nanoprobe useful not only for in vivo detection of inflammation but also for tumor-specific theranostic applications.