Simulated annealing algorithm was applied in the decomposition of neutron and x_ray powder diffraction pattern. The method described in this paper has two main advantages: first, the pattern decomposition results do not depend on the starting peak parameters, thus the difficulty in the choice of initial solutions, which occurs in fitting a complex pattern composed of severely overlapped peaks by a conventional least_squares profile fitting method, is overcome; secondly, it has the ability of searching for global other than local optimal solutions, thus can effectively resolve the multi_solution problem mathematically, and this advantage is the most useful when decomposing complex patterns with several local optimal solutions. The computing step is described in detail, the setting of relative parameters is discussed, and the simulated annealing method is compared with a conventional least_squares profile fitting method through both simulated pattern and actual pattern to demonstrate its unique advantage in the decomposition of complex pattern. In principle, the method can also be applied in other kinds of spectra which can be described by profile shape function.