Bimolecular and monomolecular cracking mechanisms of alkanes simultaneously occur and have a competitive relationship, which strongly influences product distribution. In this work, the density functional theory (DFT) is firstly carried out to elucidate two cracking mechanisms in HZSM-5 and HY zeolites. It is found that the overall apparent reaction barrier for the monomolecular cracking reaction at 750 K in the HZSM-5 zeolite is 5.30 kcal/mol, much lower than that (23.12 kcal/mol) for bimolecular cracking reaction, indicating that monomolecular mechanism is predominant in the HZSM-5 zeolite. In contrast, the bimolecular mechanism is predominant in the HY zeolite due to lower apparent reaction barrier energy barrier (6.95 kcal/mol) for bimolecular cracking reaction than that (24.34 kcal/mol) for the monomolecular cracking reaction. Moreover, the intrinsic reason for the different mechanisms is further elucidated. The confinement effect can effectively decrease energy barrier when the size of transition state is comparable to pore-size of zeolite.The insights in this work will be of great significance to the understanding of confinement on catalytic cracking mechanism and to the design of highly efficient cracking catalysts.