The invention discloses a cobalt complex and a preparation method thereof, and the cobalt complex is characterized by having good electrocatalytic activity on hydrogen peroxide, the molecular formula of the cobalt complex is C26H26N4O10Co, the crystal system is orthorhombic, the space group is Pbcn, the cell parameters alpha, gamma and beta satisfy: a=15.928Angstrom, b=10.602Angstrom, c=15.596Angstrom, alpha is equal to gamma, is equal to beta and is equal to 90 degrees. The cobalt complex prepared in the invention is obtained by a mixing reaction of a cobalt salt and a derivative of 5-aminosalicylic acid, namely, 5-((2-pyridyl) methylene amino)-2-hydroxybenzoic acid according to a certain proportion, the cobalt complex has a specific spatial structure and an accurate molecular formula, the synthesis steps are simple, the yield can reach 45-70%, and the cobalt complex has good electrocatalytic activity, thereby being capable of being used as an electrocatalytic active material having a potential application prospect.