The invention provides a data cable with a telescoping function, including a USB plug, a fixed shell, upper fixed blocks, lower fixed blocks and a pressing rod, the fixed shell is sleeved in the rightposition of the USB plug, the upper fixed blocks are fixedly installed on the top surface inside the fixed shell, the lower fixed blocks are fixedly connected with the bottom surface inside the fixedshell, the pressing rod is movably connected with the internal middle position of the fixed shell, and the inner side of the USB plug is fixedly connected with a data cable. The damage caused by thedirect contact between the data cable and the outside world is effectively avoided, so that that service life is prolonged, the two ends of the data cable is effectively prevented from being pulled off, the service life is prolonged, the data cable can be freely stretched and contracted, and can be freely adjusted in length, has a good use effect, is convenient to carry, has strong practicability,is suitable for the production and use in the field of data cables with a telescopic function, and has good development prospects.