The invention provides a leg separating mechanism for a medical bed. The leg separating mechanism comprises an electric telescopic rod I, a supporting plate I, a supporting plate II, an electric telescopic rod II, a vertical plate II, a vertical plate I, a gear, a lead screw, a leg bearing plate and a rack, wherein the electric telescopic rod I and the electric telescopic rod II are symmetricallyarranged on the left end face and the right end face in a cavity, the supporting plate I is installed on the right end face of the electric telescopic rod I, the supporting plate II is installed on the left end face of the electric telescopic rod II, the vertical plate II is installed on the upper end face of the supporting plate II, and the vertical plate I is installed on the upper end face of the supporting plate I. A function of separating the legs of patient is achieved by adopting the design, the gear is assembled at the middle position in a groove body and is meshed with the rack, the lead screw is assembled at the middle position in a moving groove, the leg bearing plate is arranged on the right end face of the vertical plate II, and the rack is fixed to the rear end face in the cavity. By adopting the design, an automatic leg lifting function is achieved, and the leg separating mechanism is simple in structure, convenient to operate, high in use comfort and good in stability.