A hinge module and an electronic device are provided. The electronic device includes a first body and a second body that the hinge module is connected therebetween, and the first and the second bodies are rotated to be folded or unfolded through the hinge module. The hinge module includes a guiding member, a first rail, a rotating shaft, and a linking member. The rotating shaft disposed at the first body in a rotatable and penetrating manner. The linking member is linked between the rotating shaft and the guiding member. The first and the second bodies are rotated relatively to each other via the guiding member and the first rail, and the guiding member drives the linking member to rotate the rotating shaft.