A portable keyboard comprising: a polygonal pillar-shaped main body having a recessed part; a key assembly that is formed adjacent to the polygonal pillar-shaped main body and includes a plurality of key arrangements (121, 122, 123, 124, and 125) each having multiple keys formed in a first direction, the key arrangements (121, 122, 123, 124, and 125) formed in a second direction intersecting the first direction, so that the key arrangements (121, 122, 123, 124, and 125) cover each side of the polygonal pillar-shaped main body when rolled up onto the polygonal pillar-shaped main body, wherein a magnet is provided in the key assembly; a flexible connecting member electrically connecting the key assembly and the polygonal pillar-shaped main body; a pair of rotary members (221, 222) each including a hinge part fixed at the polygonal pillar-shaped main body and a supporting part extending from a fitting part that extends from the hinge part and has a slot to fit in a mobile terminal, wherein each rotary member is rotatable around the hinge part; a magnet embedded in both rotary members (221, 222); a hall sensor arranged in the polygonal pillar-shaped main body and adapted to detect whether the rotary members (221, 222) are unfolded or whether the key assembly is rolled up; and a controller adapted to control the operation of the key assembly, wherein the controller is configured to turn off the portable keyboard in a first state where the pair of rotary members (221, 222) is disposed in the recessed part or where the key assembly is rolled up around the polygonal pillar-shaped main body and to turn on the portable keyboard in a second state where the pair of rotary members (221, 222) is released from the recessed part or where the key assembly is unrolled from the polygonal pillar-shaped main body. a polygonal pillar-shaped main body having a recessed part; a key assembly that is formed adjacent to the polygonal pillar-shaped main body and includes a plurality of key arrangements (121, 122, 123, 124, and 125) each having multiple keys formed in a first direction, the key arrangements (121, 122, 123, 124, and 125) formed in a second direction intersecting the first direction, so that the key arrangements (121, 122, 123, 124, and 125) cover each side of the polygonal pillar-shaped main body when rolled up onto the polygonal pillar-shaped main body, wherein a magnet is provided in the key assembly; a flexible connecting member electrically connecting the key assembly and the polygonal pillar-shaped main body; a pair of rotary members (221, 222) each including a hinge part fixed at the polygonal pillar-shaped main body and a supporting part extending from a fitting part that extends from the hinge part and has a slot to fit in a mobile terminal, wherein each rotary member is rotatable around the hinge part; a magnet embedded in both rotary members (221, 222); a hall sensor arranged in the polygonal pillar-shaped main body and adapted to detect whether the rotary members (221, 222) are unfolded or whether the key assembly is rolled up; and a controller adapted to control the operation of the key assembly, wherein the controller is configured to turn off the portable keyboard in a first state where the pair of rotary members (221, 222) is disposed in the recessed part or where the key assembly is rolled up around the polygonal pillar-shaped main body and to turn on the portable keyboard in a second state where the pair of rotary members (221, 222) is released from the recessed part or where the key assembly is unrolled from the polygonal pillar-shaped main body.