Reliable localization is a crucial prerequisite for robots to perform navigation and path planning. Traditionally, locations of robots are derived from the ranging measurements between ultra-wideband (UWB) tag and anchors, results with poor accuracy may be yielded when available anchors are insufficient. To tackle this issue, a mobile robot localization method based on ultra-wideband bearing and range is proposed. Firstly, the direction of the UWB tag, i. e. , the forward field of view ( FOV) or behind non-field of view (NFOV) of the anchor, is determined according to the standard deviation of the UWB bearing signal, thus eliminating the front-back singularity in the robot localization process. In addition, constraint functions are constructed utilizing UWB range and bearing measurements, and global pose optimization is achieved by fusing odometry and UWB measurements through a graph-based optimization algorithm. The experiment results show that the proposed method has strong robustness and is able to locate the irregularly moving robot with a localization accuracy of 0. 093 m in a 13 m×6 m indoor environment, which is 46% better than the traditional localization method based on ranging UWB and odometry fusion.