A portable electronic device includes a main body and a functioning module. The main body has an accommodation space. The main body includes at least one magnetic connecting portion disposed in the accommodation space. The functioning module is detachably accommodated in the accommodation space. The functioning module has a functioning surface and a connecting surface. The connecting surface includes at least one first magnetic piece. When the functioning module is accommodated in the accommodation space, the first magnetic piece is magnetically connected with the magnetic connecting portion.