The invention discloses a side lock for a coded lock and the coded lock, and relates to the technical field of locks. The side lock comprises a coded lock body, wherein a key lock mechanism is arranged at the position, close to the left side edge, of the front end of the coded lock body, a sliding groove is formed in the position, close to the right side edge, of the surface of the front end of the coded lock body, a first mounting plate is arranged at the rear end of the coded lock body, and a second mounting plate is arranged at the rear end of the coded lock body and located on the right side of the first mounting plate. According to the side lock for the coded lock and the coded lock, transmission parts of the side lock can be reduced, the transmission relation is simplified, the transmission control performance is more stable and reliable, the structure of the side lock is simpler and more compact, the side lock is convenient to assemble, a code case can be opened through a key when a password wheel lock is forgotten, the situation that the code case cannot be used is prevented, rapid combination of the side lock and the code case can be facilitated, the side lock and the code case can be rapidly assembled and disassembled, and the side lock can be conveniently replaced.