The application discloses an electronic device and a camera module, wherein the camera module includes: a camera, a circuit board, a base, a support and a flexible electrical connector, the camera is installed on the base, the camera can move relative to the base, and the camera It is arranged on one side of the circuit board, the supporting member is arranged between the circuit board and the camera, the optical axis of the camera extends along the first direction, and the flexible electrical connector includes a first section, a second section and a third section connected in sequence, and the first section One end of one section away from the second section runs through the support and is electrically connected to the camera, the first section extends away from the support along a second direction, the second direction is perpendicular to the first direction, and the second section is away from the support toward the circuit board The member extends, and the third segment extends along the first direction toward the camera. In this application, by raising the camera head, the area for bending the flexible electrical connector in the camera module is increased, which is beneficial to relieve the pulling of the camera by the flexible electrical connector.