In future space-borne gravitational wave (GW) detectors, time delay interferometry (TDI)will be utilized to reduce the overwhelming noise, including the laser frequency noise and the clocknoise etc., by time shifting and recombining the data streams in post-processing. The successfuloperation of TDI relies on absolute inter-satellite ranging with meter-level precision. In this work, wenumerically and experimentally demonstrate a strategy for inter-satellite distance measurement. Thedistances can be coarsely determined using the technique of arm-locking ranging with a large nonambiguity range, and subsequently TDI can be used for precise distance measurement (TDI ranging)by ffnding the minimum value of the power of the residual noises. The measurement principle isintroduced. We carry out the numerical simulations, and the results show millimeter-level precision.Further, we perform the experimental veriffcations based on the ffber link, and the distances can be measured with better than 0.05 m uncertainty, which can well satisfy the requirement of time delayinterferometry.