The invention belongs to the field of robot engineering, and particularly relates to an underwater hydraulic linear cylinder mechanism with a position feedback function. The two ends of a cylinder body are connected with a sealing cover and an end cover in a sealed mode correspondingly. A sealing plug is mounted in the end, close to the sealing cover, of the cylinder body. A sensor is arranged inside the cylinder body. A piston is connected with the end cover in a sealed mode and can move relative to the end cover, one end of the piston is located in the cylinder body and provided with a slip ring, and the other end of the piston penetrates out of the end cover. A sensor detector is mounted on the sealing plug in a sealed mode, one end of the sensor detector is located between the sealing plug and the sealing cover, and the other end of the sensor detector is inserted into the piston through the slip ring. In the cylinder body, the sealed space between the sealing cover and one end of the sensor detector is a compensation oil cavity, the sealed space between the sealing plug and one end of the piston is a rodless cavity, and the sealed space between one end of the piston and the end cover is a rod cavity; the cylinder body is provided with pipe joints communicating with the compensation oil cavity, the rodless cavity and the rod cavity correspondingly. The underwater hydraulic linear cylinder mechanism has the advantages of being compact in structure, complete in function, low in failure rate, capable of working at any sea depth position and the like.