Cyclization is an important chemical reaction for the dipeptides containing N-alkyl groups. The cyclization mechanism has been examined by theoretical calculations. Our calculation results indicate that the most favorable mechanism is the piperidine-catalyzed stepwise mechanism, in which piperidine acts as a proton shuttle. The attack of the N-terminal amino nitrogen at the C-terminal carbonyl carbon along with the proton transfer is the rate-limiting step. The effect of the alkyl substituent on the amide N on the cyclization reaction was then examined. Finally, the influence of the solvation effect, electronic effect and steric effect on the cyclization was investigated. It is found that all of these effects contribute to the cyclization.