Indoor positioning systems have received increasing attention for supporting location-based services in indoor environments. Wi-Fi based indoor localisation has become attractive due to its extensive distribution and low cost properties. IEEE 802.11-2016 now includes a Wi-Fi Fine Time Measurement (FTM) protocol which can be used for Wi-Fi ranging between intelligent terminal and Wi-Fi access point. This paper introduces a framework of Wi-Fi FTM data acquisition and processing that can be used for indoor localisation. We analyse the main factors that affect the accuracy of Wi-Fi ranging and propose a calibration, filtering and modelling algorithm that can effectively reduce the ranging error caused by clock deviation, non-line-of-sight (NLOS) and multipath propagation. Experimental results show that the proposed calibration and filtering method is able to achieve metre-level ranging accuracy in case of line-of-sight by using large bandwidth. Estimation results also show that the proposed Wi-Fi ranging model provides an accurate ranging performance in NLOS and multipath contained indoor environment; the final positioning error is less than 2·2 m with a stable output frequency of 3 Hz.