The formation mechanism and pathway of HMF from fructose dehydration were investigated using in-line FTIR monitoring and in-situ 13C NMR in this study. The results of the infrared absorption spectrum obtained at different time intervals during the reaction process showed significant inconsistencies with the acyclic pathway. However, the in-situ NMR analysis revealed the direct observation of two intermediates, fructose furan and (4R-5R)-4-hydroxy-5-hydroxymethyl-4,5-dihydrofuran-2-formaldehyde, providing direct evidence to support the cyclic carbocation pathway. This study also included theoretical analysis of the intermediates involved in the key steps of various reaction pathways using density functional theory (DFT) calculations. The key steps in the cyclic pathway were found to have lower activation energy compared to the acyclic pathway, while exhibiting significant differences in electronegativity at the reaction sites. The computational results not only reveal but also provide support for the rationality of the cyclic formation mechanism. The response surface methodology (RSM) was utilized to optimize the preparation process of HMF through fructose dehydration. It enabled determination of the significance order for each factor (reaction temperature > reaction time > mass percentage of water in the solvent) and identification of the optimal process conditions (reaction time of 3.5 h, reaction temperature of 143.5 °C, mass percentage of water in the solvent of 5.0 %, and maximum yield of 5-HMF reaching 82.4 %).