The work is devoted to the study of the interaction of hydrogen with point defects (vacancy, bivacancy, trivacancy, stacking fault tetrahedron, intrinsic interstitial atom) and linear (complete and partial edge dislocations, screw dislocation) defects in Pd and Ni by the method of molecular dynamics. The bond energies of the hydrogen impurity with considered defects were obtained. It is shown that the most effective hydrogen traps in Pd and Ni are vacancies and vacancy clusters. The high sorption capacity of vacancies should contribute to significantly effect of their concentration on the overall sorption capacity of the metal, especially for metals such as Ni, for which the energy of absorption by vacancies and vacancy clusters is negative while the absorption energy by a pure crystal is positive. The presence of dislocations and dislocation complexes in Ni, low-angle grain boundaries, according to the obtained data, weakly affects to the sorption ability of the metal in comparison with vacancies and vacancy clusters.