The invention belongs to the technical field of communication and provides a method and device for determining a code phase of a
ranging code, and a user terminal. The method comprises the steps of SA, obtaining discrete data; SB, obtaining carrier stripped data; SC, carrying out code matching operation according to the carrier stripped data and an initial position of sampling points, thereby obtaining a code matching result; SD, carrying out code phase search according to the code matching result and the locally copied
ranging code; and SE, carrying out
peak detection, if peaks are captured successfully, storing the captured peaks, adding the initial position of the sampling points and the step size x of the initial position, returning to the SC until the initial position of the sampling points is greater than the number p of the sampling points in a
chip, and if the initial position of the sampling points is greater than the p, comparing p / x stored peaks, and finding the maximum peak, wherein the code phase of the
ranging code is the code phase corresponding to the maximum peak. Through application of the method, the device and the user terminal, the code phase precision of the ranging code can be increased, and an area of a correlator is not increased.