Tracking the user location in indoor environment becomes substantial issue in recent research High accuracy and fast convergence are very important issues for a good localization system. One of the techniques that are used in localization systems is particle swarm optimization (PSO). This technique is a stochastic optimization based on the movement and velocity of particles. In this paper, we introduce an algorithm using PSO for indoor localization system. The proposed algorithm uses PSO to generate several particles that have circular distribution around one access point (AP). The PSO generates particles where the distance from each particle to the AP is the same distance from the AP to the target. The particle which achieves correct distances (distances from each AP to target) is selected as the target. Four PSO variants, namely standard PSO (SPSO), linearly decreasing inertia weight PSO (LDIW PSO), self-organizing hierarchical PSO with time acceleration coefficients (HPSO-TVAC), and constriction factor PSO (CFPSO) are used to find the minimum distance error. The simulation results show the proposed method using HPSO-TVAC variant achieves very low distance error of 0.19 meter.