The wavelength shift of a long-period fiber grating (LPG) related to re-distribution of hydrogen molecules was studied by the finite-element method (FEM) calculation and by the experiment. The FEM calculation was performed solving a diffusion equation of hydrogen in glass fiber, and the wavelength of an LPG was calculated. In the experiment, the hydrogen-loaded fiber was out-diffused before laser exposure, and the resonance wavelengths of LPGs fabricated by exposure were measured. The wavelength depended on the duration of out-diffusion, and the variation was up to 114nm. The FEM calculation considering the hydrogen re-distribution by out-diffusion agreed with the experiment. After the laser exposure, the wavelength of an LPG shifted towards the long wavelength without any exposure. The FEM calculation assuming hydrogen depletion in the core and its recovery agreed with the measured wavelength shift. Extension of the FEM to fibers with more complicated structures has been discussed.