We report a self-supporting electrode fabricated by covering iron doped mesoporous cobalt phosphide film on carbon cloth substrate (meso-Fe x Co 1-x P/CC) for hydrogen evolution reaction (HER). In acidic and alkaline electrolytes, the electrode exhibited excellent catalytic activity and fast kinetics towards the HER, only requiring small overpotentials of 61 mV and 67 mV to drive 10 mA cm −2 , respectively. The superior electrocatalytic activity is attributed to the mesoporous structure with high specific surface area (147.5 m 2 g −1 ) and doping of Fe atom. The mesoporous structure grown on the conductive carbon cloth substrate enables the fully exposure of active sites and the rapid penetration of electrolyte. Additionally, density functional theory (DFT) calculation reveals that the doping of Fe enhances the adsorption of H atoms by shifting the d-band center of Co. Meanwhile, the introduction of Fe lowers the energy barrier for water dissociation, which accelerates the catalytic kinetics in alkaline electrolyte. Mesoporous Fe doped CoP with high active sites density and optimized Electronic Structure for hydrogen evolution electrocatalysis. • Mesoporous Fe doped CoP with the optimized electronic structure and high active site density was synthesized. • The doping of Fe upshifts the d-band center, optimizes the ΔG H∗ and lowers the dissociation energy barrier of water. • The catalyst exhibits extremely high intrinsic activity and fast kinetics.