A foldable electronic device includes a first body, a second body, a pivot module, a linkage mechanism, and an input module. The pivot module is connected to the first body and the second body. The second body is pivoted on the first body through the pivot module. The linkage mechanism is disposed in the first body and is connected to the pivot module. The input module is movably disposed on the first body through the linkage mechanism. The linkage mechanism is configured to be driven by the pivot module to cause the input module to move to be close to or away from the pivot module and cause the input module to be inclined or parallel to the first body.