An effective and eco-friendly catalyst for hydrogen evolution reaction (HER) shows significance for new clean energy technologies. The TMPs are generally regarded as efficient electrocatalysts for HER. Unfortunately, the synthetic procedures of TMPs usually suffered from high cost, complexity, and toxicity caused by the use of chemical phosphorus sources. Phosphorus and nitrogen pollution lead to water eutrophication and consequent algae blooms. We use a kind of algae (caused by eutrophication) to develop TMP nanoparticles supported on the porous carbon matrix for HER by a one-step calcination treatment, the preparation method is sustainable, economical, and effective. For the optimal catalyst Co2P nanoparticles supported on chlorella-derived porous N-doped carbon matrix (Co2P-C-NPC), the HER overpotential is measured to be 151 mV (acid condition) and 252 mV (alkaline condition) at the current density of 10 mA cm−2. The excellent HER performance results from the uniform dispersity, high content of carbon, phosphorus and nitrogen in the algae, the algae's high surface and porosity. If adverse element-rich biomass can be converted into a useful catalyst material, then the efficient and eco-friendly for water splitting is possible.