Indoor positioning in dynamic environment is easy to be interfered by human’s random actions and obstacles. The time-varying signal strength and the instability of data acquisition have a great impact on the positioning algorithm. To solve the problem, this paper proposes an online sequential extreme learning machine algorithm based on particle swarm optimization named PSO-OS-ELM. The algorithm inherits the characteristics of the on-line sequential extreme learning machine (OS-ELM) algorithm, such as low data acquisition cost, fast adaptation to environmental changes, fast convergence speed and high positioning accuracy. At the same time, the particle swarm optimization (PSO) is used to solve the singular value problem and instability problem in the OS-ELM algorithm. The PSO-OS-ELM algorithm, the OS-ELM algorithm and the weighted K-nearest neighbor(WKNN) algorithm are compared. The experimental results show that in the dynamic indoor environment, in terms of algorithm stability, the PSO-OS-ELM algorithm has smaller and stable positioning error, and is better than other algorithms. Compared with other algorithms, the average positioning error is reduced by about 15%. Compared with the traditional localization algorithm, the WKNN algorithm reduces the time consumption by about 55%.