Multiwall carbon nanotubes (MWCNTs) have been applied extensively in various aspects of advanced materials development. However, the purification of multi-walled carbon nanotubes and the removal of internally confined metal impurities, without compromising the CNT structural integrity, have proved to be a great challenge. The presence of inherent metal impurities has increased the complexity and health risks associated with the use of MWCNTs. In this study, we developed a low-cost purification strategy to effectively remove encapsulated metal impurities. MWCNTs synthesized by Ni-catalyzed chemical vapor deposition (CVD), were annealed in the presence of melamine under Ar-atmosphere protection at 1000 °C. Electron microscopy indicated that the pyrolysis of MWCNTs in the presence of melamine induces the leaching of encapsulated Ni particles via the tube open-end or the defect sites found along the MWCNTs. With this method, the leached impurities were shown to be more susceptible and accessible to acid purification. Upon acid treatment, ultrapure MWCNTs with trace amounts of metallic impurities (<0.01 wt%) can be achieved. Alternatively, the leached metal nanoparticles could serve as highly efficient electrocatalytically active sites for oxygen evolution reactions with a turn over frequency (TOF) of 0.61 s-1.