In recent years, mobile robots have found extensive application across diverse sectors including industry, agriculture, healthcare, and defense. However, relying solely on a single sensor for mobile robot localization presents several challenges, such as limited accuracy, divergence of localization errors over time, and susceptibility to obstruction from obstacles. This paper proposes an indoor mobile robot localization algorithm assisted by Ultra-Wideband (UWB). The algorithm begins by calculating the credibility of the Line-of-Sight (LOS) environment using UWB ranging measurements and predicted distances, enabling the identification of the Non-Line-of-Sight (NLOS) environment. Subsequently, ranging measurements affected by NLOS errors are compensated by using a complementary filter. Finally, these measurements are utilized for Extended Kalman Filter updates to achieve the best estimation of the mobile robot’s position. Field tests are conducted on a wheeled robot to validate the effectiveness and performance of the developed approach. Results show that the localization approach reduces the maximum localization error from 41 cm to 19 cm compared to UWB trilateration, achieving a 53.7% improvement. Even under a prolonged NLOS environment, the algorithm ensures that the localization error remains below 25 cm. The proposed method is of significant merit in solving the challenge of indoor mobile robot localization.