Nowadays, sustainability-related issues have attracted growing attention due to fossil fuel depletion and environmental concerns. Considering many cities have gradually replaced taxis with electric vehicles (EVs), to reduce greenhouse gas emissions and traditional energy consumption, this paper studies the optimization strategy of battery swapping for electric taxis (ETs), and it is not only to ease congestion in the battery swapping station (BSS) but also for electric taxis to address their range anxiety and maximize their benefits. Firstly, based on the road network, the Dijkstra algorithm is adopted to provide the optimal path for ETs to BSSs with the minimum energy consumption. Then, this paper proposes the optimization objective function with minimum cost, which contains the battery service cost based on the battery’s state of charge, waiting cost caused by waiting for swapping battery in BSSs and the carbon emission reduction benefit generated during ETs driving to BSSs, and uses a mixed-integer linear programming (MILP) algorithm to solve this function. Finally, taking the Leisure Park of Laoshan City in Beijing as an example, the numerical simulation is carried out and the proposed battery swapping strategy is efficient to alleviate the congestion of BSSs and maximize the total benefit of ETs, and the cost based on the proposed strategy is 14.21% less than that of disorderly swapping.