In recent years, many new technologies have been used in indoor positioning. In 2016, IEEE 802.11-2016 created a Wi-Fi fine timing measurement (FTM) protocol, making Wi-Fi ranging more robust and accurate, and providing meter-level positioning accuracy. However, the accuracy of positioning methods based on the new ranging technology is influenced by non-line-of-sight (NLOS) errors. To enhance the accuracy, a positioning method with LOS (line-of-sight)/NLOS identification is proposed in this paper. A Gaussian model has been established to identify NLOS signals. After identifying and discarding NLOS signals, the least square (LS) algorithm is used to calculate the location. The results of the numerical experiments indicate that our algorithm can identify and discard NLOS signals with a precision of 83.01% and a recall of 74.97%. Moreover, compared with the traditional algorithms, by all ranging results, the proposed method features more accurate and stable results for indoor positioning.