Recently, interest in ultrawideband (UWB)-based localization systems has increased in various application fields. However, since UWB anchors are usually fixed, they work only within the limited range that UWB measurement signals can reach. To address this issue, a swarm flight system with movable UWB anchors is developed. One ground station controls multiple unmanned aerial vehicles (UAVs), each of which is equipped with a UWB anchor and real-time kinematic global positioning system (RTK-GPS) capabilities, and collects the precise (centimeter-level) positions of the UWB anchor UAVs through RTK-GPS. In this way, the constraints of existing UWB systems can be alleviated by changing the UWB anchor positions in real time as desired by the user. In addition, this paper proposes a novel localization algorithm using only time-of-flight (TOF) measurements from UWB signals, heading information from an attitude and heading reference system (AHRS), and altitude information from a barometer. The results of UAV flight tests show that the proposed algorithm provides better localization performance than existing algorithms.INDEX TERMS Interacting multiple model, Kalman filter, localization, swarm flight system, ultrawideband (UWB), unmanned aerial vehicle (UAV).