The application discloses a hinge mechanism and an electronic device, the hinge mechanism comprises a hinge support, a connecting support, a swing arm and a damping device, the first end of the swing arm is rotationally connected with the hinge support, the second end of the swing arm is slidingly connected with the connecting support, the damping device is arranged on the connecting support, and the second end of the swing arm is slidingly matched with the connecting support when the first end of the swing arm rotates relative to the hinge support; the damping device comprises a first damping piece and a second damping piece, the first damping piece and the second damping piece are arranged in a staggered manner in a first direction, the first direction is a direction in which the hinge support points to the connecting support; the swing arm interacts with the first damping piece when the folding angle of the hinge mechanism is in a first interval; the swing arm interacts with the second damping piece when the folding angle of the hinge mechanism is in a second interval; and the first interval and the second interval do not intersect.