Concerning the error accumulation problem in mobile robot localization, a adaptive extended Kalman filter (AEKF) algorithm is presented. The extended Kalman filter and adaptive Kalman filter algorithms are analyzed. AEKF use the Taylor series in sampling time and the Sage-Husa time-varying noise estimator to estimate observation noise in real time, it overcomes the linearization error and enhance the environmental adaptability. Meanwhile, the AEKF convergence and complexity of operation are analyzed and combined with experiments show that AEKF has good comprehensive performance in terms of speed and precision. Finally, the effect of robot localization completed by two kinds of algorithm is analyzed and the error comparison by experiment is completed. The results indicate AEKF has better performance on localization.