WiFi-based indoor positioning is widely exploited thanks to the existing WiFi infrastructure in buildings and built-in sensors in smartphones. The techniques for indoor positioning require the high-density training data to archive high accuracy with high computation complexity. In this paper, the approach for indoor positioning systems which is called the maximum convergence algorithm is proposed to find the accurate location by the strongest receiver signal in the small cluster and K nearest neighbours (KNN) of other clusters. Also, the K-mean clustering is deployed for each access point to reduce the computation complexity of the offline databases. Moreover, the pedestrian dead reckoning (PDR) method and Kalman filter with the information from the received signal strength (RSS) and inertial sensors are applied to the WiFi fingerprinting to increase the efficiency of the mobile object's position. The different experiments are performed to compare the proposed algorithm with the others using KNN and PDR. The recommended framework demonstrates significant proceed based on the results. The average precision of this system can be lower than 1.02 meters when testing in the laboratory environment with an area of 7x7 m using three access points.