Unmanned Aerial Vehicle (UAV) path planning is to plan an optimal path for its flight in a specific environment. But it cannot get satisfactory results using ordinary algorithms. To solve this problem, a hybrid algorithm is proposed named as PESSA, where particle swarm optimization (PSO) and an enhanced sparrow search algorithm (ESSA) work in parallel. In the ESSA, the random jump of the producer’s position is strengthened to guarantee the global search ability. Each scrounger keeps learning from the vintage experience of the producers. For the best-positioned sparrow, when it perceives the threat, the difference between the best individual and the worst individual will be imposed to speed up the search process. The elite reverse search strategy was added to yields the optimum diversity. In this paper, the performance of the PESSA algorithm is verified by 10 basic functions, and it can find the optimal value on the 7 test functions. Compared with the other 12 algorithms, PESSA’s average value always ranks first. Finally, the proposed PESSA is applied in 4 different scenarios including two groups of 2D environments and two groups of 3D environments. In 2D environments, the average optimization results can reach 0.0165 and 0.0521 in two cases respectively. In 3D environments, the average optimization results can reach 0.6635 and 0.5349 in two cases respectively. The results show that the PESSA algorithm can acquire more feasible and effective route than compared algorithms.