Nanosized self-assemblies built from inorganic nanoparticles and polymer ligands have the potential to generate personalized theranostics systems for diagnostic imaging and cancer therapy. However, most of the theranostics systems suffer from poor targeting activity, insensitive diagnosis and drug leakage, leading to poor treatment results. In this study, a hierarchical tumor acidity-responsive magnetic nanobomb (termed HTAMN) was developed for photodynamic therapy and diagnostic imaging. The HTAMNs were formed through the self-assembly of chlorin e6 (Ce6)-functionalized polypeptide ligand, methoxy poly (ethyleneglycol)-block-poly (dopamine-ethylenediamine-2,3-dimethylmaleic anhydride)-L-glutamate-Ce6 [mPEG-b-P (Dopa-Ethy-DMMA)LG-Ce6] and superparamagnetic iron oxide nanoparticles (SPIONs). Negatively charged HTAMNs circulate in the blood for prolonged periods and promote tumor retention by passive targeting to the tumor. Once the HTAMNs arrive at the tumor location, the acidic extracellular tumor environment reverses the surface charge of the HTAMNs, resulting in tumor accumulation and cellular uptake. Moreover, in response to the more acidic environment inside cells, the photosensitizers are activated resulted in enhanced diagnostic imaging and cancer treatment. The in vitro and in vivo results indicate the effective tumor accumulation, internalization, diagnostic sensitivity and superior photodynamic therapy effect of the HTAMNs. Therefore, designing smart HTAMNs can promote the rapid development of cancer theranostics for clinical implementation.