In this paper, K nearest neighbor algorithm is improved in fingerprint information matching in WiFi indoor positioning system. Because the original K nearest neighbor algorithm ignores the relationship between the neighboring points, it doesn’t improve matching accuracy, and its positioning accuracy is not better. There is no effective treatment group sample points, matching time is greatly increased. In this paper, we study a modified K nearest neighbor algorithm in the application of WiFi indoor positioning. Because K neighbor points are given different weights according to certain rules, the matching accuracy is improved before matching method. And because of using grouping pretreatment of the sample space, the time of position matching accuracy is reduced. Therefore the positioning precision is improved.