In order to study the explosion process of carbon-iron nanomaterials synthesized by gaseous detonation, the effects of different molar ratios of hydrogen-oxygen (2:1, 3:1, 4:1) on the peak value time-history curve of detonation parameters (detonation velocity, detonation temperature, detonation pressure) and the morphology of carbon-iron nanomaterials were studied by combination of hydrogen-oxygen experiments and numerical simulations. The explosion experiments used hydrogen and oxygen with a purity of 99.999% in a closed detonation tube. The precursor was ferrocene with a purity of 99%. A high-speed camera was used to observe in the middle of the tube. After the experiments, the samples were collected and characterized by transmission electron microscopy. The numerical simulation used ICEM software for modeling and meshing and then used FLUENT software to verify the rationality of the mesh size, and then performed simulation calculations after confirming the optimal mesh size. The results that hydrogen-oxygen explosion inside a detonation tube involves two processes: the propagation of explosion/detonation waves and the attenuation of combustion waves, and the hydrogen-oxygen molar ratio has a significant impact on the peak time history curves of detonation velocity, detonation temperature, and detonation pressure. With the increase of the molar ratio of hydrogen to oxygen, the detonation velocity, detonation temperature, detonation pressure and attenuation rate of the explosion/detonation wave all decrease. The molar ratio of hydrogen to oxygen affects the morphology growth of carbon-iron nanomaterials by influencing the propagation and attenuation of explosion/detonation waves. At zero oxygen ballance, the sample consists of carbon-coated iron nanoparticles. As the hydrogen-oxygen molar ratio increases, the number of carbon nanotubes in the sample gradually increases. Adjusting the molar ratio of hydrogen to oxygen can achieve control over the propagation and attenuation process of explosions/detonation waves, and also achieve the goal of controlling the preparation of carbon iron nanomaterials with specific morphologies through gaseous detonation.