When wireless sensor network is used for indoor trajectory tracking of mobile nodes, the random noise in the environment will affect the stability and accuracy of localization. In order to solve this problem, this paper proposed an indoor trajectory tracking algorithm based on Kalman filter and geomagnetic intensity. Firstly, RSSI data are measured by the Zigbee nodes of the wireless network and the Kalman filter algorithm is used to track the trajectory. Then the distance measurement algorithm is used to search and match the geomagnetism data to locate the trajectory further. In order to verify the effectiveness of this algorithm, the indoor moving target will be located in real time through the measured data. The experimental results show that the localization has a better accuracy after adding the results of geomagnetic intensity matching.