The diffusion coefficients of hydrogen (H) and deuterium (D) in Pd were determined in the frame of a quantum mechanical consideration. The three dimensional (3D) wave functions and eigenenergies of H and D at a stable octahedral (o) site and a metastable tetrahedral (t) site were determined by solving the Schrödinger equation with 3D potentials obtained by the first principles calculation. The states of H and D along the diffusion path were also determined by using transient potentials which were obtained with an aid of the nudged elastic band method. The magnitudes of tunneling matrix elements (J) were evaluated from the eigenenergy curves along the diffusion path. In the Pd-H system, thermally activated tunneling transitions are dominant jump processes. On the other hand, in the Pd-D system, it is revealed that a transition via an extended state where the wave function spreads both to o- and t-sites also has a considerable contribution to the diffusion. The calculated diffusion coefficients for H and D quantitatively agreed with experimental values and the so-called inverse isotope effect was reproduced.