Optical imaging in vivo holds significant implications for disease diagnosis, and nanoprobes with near-infrared (NIR) emission leverage the deep tissue penetration and high spatiotemporal resolution provided by NIR light, demonstrating considerable application potential. This study presents the design and synthesis of three nitrogen-doped boron–dipyrrin (Aza-BODIPY) molecules: Aza–BDP–OCH3, Aza–BDP–OH, and Aza–BDP-I. Leveraging the strong electron-accepting properties of the Aza-BODIPY core, we developed a donor–acceptor–donor (D-A-D) structure for Aza–BDP–OCH3 through modifications with triphenylamine and methoxy groups, resulting in NIR fluorescence. Aza–BDP–OH was obtained via demethylation using boron tribromide, whereas Aza–BDP-I was synthesized by introducing iodine into Aza–BDP–OCH3. These three molecules self-assemble with the amphiphilic polymer PMHC1818-mPEG to form nanoparticles (NPs), yielding optical nanoprobes. The resulting NPs exhibit NIR emission, good water solubility, and biocompatibility. At a concentration of 100μg⋅mL−1μg⋅mL−1, these NPs demonstrate low biological toxicity, highlighting their potential for biological applications. Following tail vein injection, Aza–BDP-I NPs accumulate in tumors and effectively illuminate them via the enhanced permeability and retention (EPR) effect. Furthermore, these organic NPs were metabolized by the liver. Therefore, Aza-BODIPY-based NIR fluorescent NPs offer a promising platform for the development of in vivo optical nanoprobes.