The foldable electronic device of the present disclosure includes a first housing of an electronic device, a second housing corresponding to the first housing, and a hinge structure connecting the first housing and the second housing, the housing being switchable between a folded state or an unfolded state around the hinge structure, the first housing including a first edge and a second edge extending perpendicularly from the first edge, the second housing including a third edge corresponding to the first edge and a fourth edge corresponding to the second edge and extending perpendicularly from the third edge, the first housing including a first segment formed at a first point on the first edge, a grounded portion formed on the second edge, the second housing includes a third point connected to the ground on the fourth edge, a second segment formed at a point on the fourth edge, a second conductive portion extending from the second segment to the third edge along the second side, and a third conductive portion separated from the second conductive portion by the second segment, and includes a switch circuit and a processor connecting the second conductive portion and the third conductive portion, and the processor electrically connects or disconnects the second conductive portion and the third conductive portion by controlling the switch circuit.