In the generalized off-shell free energy landscape, black holes can be treated as thermodynamic topological defects. The local topological properties of the spacetime can be reflected by the winding numbers at the defects, while the global topological nature can be classified by the topological number which is the sum of all local winding numbers. We propose that the winding numbers can be calculated via the residues of isolated one-order pole points of characterized functions constructed from the off-shell free energy. Using the residue method, we show that the topologies of black holes can be divided into three classes with the topological numbers being -1, 0, and 1, respectively, being consistent with the results obtained in [Phys. Rev. Lett. 129, 191101 (2022)] by using the topological current method. Moreover, we point out that standard defect points, generation and annihilation points, and critical points can be distinguished by coefficients of the Laurent series of the off-shell characterized function at those singular points.