The invention discloses a keyboard type input coded lock made of an aluminium magnesium alloy. The lock comprises a bicycle lock body, a U lock bolt, a clamp and an electronic lock. The electronic lock is arranged on the bicycle lock body, the clamp is connected with the bicycle lock body, a lock head of the U lock bolt is arranged in the bicycle lock body, and is locked and unlocked through the electronic lock, the electronic lock comprises a lock catch, and an input keyboard, the input keyboard controls opening and closing of the lock catch, and the input keyboard is arranged on the surfaceof the bicycle lock body. According to the keyboard type input bicycle lock, the U lock bolt and the lock catch in the bicycle lock body are locked, the lock can be opened only by inputting passwordson the input keyboard, meanwhile, through the input keyboard, the passwords can be modified for updating, the traditional unlocking manner through a key can be omitted, key carrying is not needed, andthe phenomenon that the lock cannot be unlocked due to key losing can be avoided.