In this paper, carrier dynamics in N,N′-diphenyl-N,N′bis(1,1′-biphenyl)-4,4′-diamine (NPB) was studied using impedance spectroscopy (IS) and particle swarm optimization algorithm (PSO). We applied PSO to fit the frequency dependence of impedance spectroscopy of NPB, and achieved the charge-carrier transit time and the dispersive parameters of NPB, and then obtained carrier mobility. The impacts of the dispersive degree on the impedance had been analyzed. Though PSO, the three unknown parameters, charge-carrier transit time τdc and dispersive degree M, α in the admittance model were achieved simultaneously. The results verified the reliability of this method. Furthermore, we have presented the advantages of PSO compared with the traditional nonlinear least squares algorithm. In our limited knowledge, this paper begins the work to study materials in the deep level of algorithm