The invention discloses a mechanical leg, and belongs to the field of electromechanical equipment. The device comprises a supporting leg and a supporting leg, wherein the supporting leg is used for being fixed to a foot, the lower leg arm is provided with a containing cavity, one end of the lower leg arm is hinged to the supporting leg and is used for being fixed to the shank, the thigh arm is provided with a storage cavity, one end of the storage cavity is hinged to the other end of the lower leg arm, the thigh arm is used for being fixed to the thigh part, the adjusting device comprises a swing gear which is rotationally arranged in the lower leg arm at two ends, a first ratchet wheel and a second ratchet wheel, wherein the first ratchet wheel is coaxially and fixedly arranged on one side of the swing gear, a driving gear which is fixedly arranged in the thigh arm and is meshed with the swinging gear, the second ratchet wheel is coaxially and fixedly arranged on one side, corresponding to the first ratchet wheel, of the driving gear, an adjusting block and a reset spring. According to the invention, the adjusting range is large, and even the forward inclination of the body can beeffectively adjusted, so that the problem that the traditional mechanical leg cannot be adjusted when the traditional mechanical leg is stretched to be close to the vertical direction is avoided, andthe adjusting amplitude range of the squatting pan is small.