The present work is focused on the numerical simulation of the deflagration to detonation transition. The Euler equations expressed for a time-dependent, compressible, and one-dimensional flow with finite-rate kinetics are solved with adaptive mesh refinement. Because of the problem stiffness, a time-step splitting method is used to couple the conservation equations and the chemical kinetics equations. The calculated length of the deflagration to detonation transition in H 2 -O 2 and CH 4 -O 2 mixtures in a confined domain and the time evolution of detonation are in good agreement with the theoretical values of constant volume explosions and Chapman-Jouguet conditions. The length of the transitional region is compared with experimental findings for a range of initial fuel concentrations, which shows that the model predicts the tendencies qualitatively well but yields significant quantitative deviations.