Indoor localization using wireless fidelity (WiFi) fingerprint has attracted considerable attention due to its extensive deployment and low cost. Most indoor fingerprint localization methods could be computationally inefficient and behave with unsatisfactory positioning accuracy. Therefore, an inverse distance weight (IDW) assisted particle swarm optimized (PSO) indoor localization (IDWPSOInLoc) algorithm is proposed. It is an optimized positioning process in the online stage rather than an offline optimization approach. The main idea is to find the optimal particle with the most similar generated fingerprint to the real-time testing one in the online stage. K nearest neighbors and boundary constraints are combined to initialize particles’ positions. The generated fingerprint of each particle is interpolated based on the IDW algorithm and nearby reference points within a specified range. A new fitness function, the sum of standard deviations between the generated and real-time testing fingerprints, is proposed to find the optimal particle. The position of the optimal particle with the minimal fitness value is taken as the estimated coordinate through iterations updating the particles’ velocities, positions, and generated fingerprints. IDWPSOInLoc achieves a mean positioning accuracy of 2.477 meters in the local environment experimental test and that of about 6 meters using selected floor in the UJIIndoorLoc dataset. Compared with state-of-the-art algorithms, positioning error is decreased by at least 11.9%. In addition, IDWPSOInLoc has the characteristic of low computational complexity. Experimental results show that the proposed IDWPSOInLoc outperforms the considered WiFi indoor positioning algorithms.