The invention relates to an ultrasonic thickness gauge having the marking function and being suitable for small pipelines. The ultrasonic thickness gauge comprises a body, a telescoping mechanism, a sliding rod, a moving board and two detection mechanisms, wherein the detection mechanisms comprise struts, curved boards, rotating assemblies, rotating boards, support boards, probes, label assembliesand multiple fastening assemblies, the fastening assemblies comprise multiple fastening units, the fastening units comprise first motors, first driving shafts, sleeves and fastening blocks, and the label assemblies comprises first rings, second rings, air pumps, air bags, second motors, first connection rods, second connection rods and label pens. The ultrasonic thickness gauge is advantaged in that pipelines are fixed through fixing assemblies, the probes are made to measure in a vertical angle, measurement precision is improved, moreover, the label pens are made to move at the desired position through the label assemblies for labeling, a detector is convenient to master the pipeline situations, and device practicality is improved.