Thermochemical hydrogen production from carboxylic acids plays a significant role in the utilization of biofuels. We employed ReaxFF molecular dynamics simulations to investigate the pyrolysis mechanisms of formic acid and acetic acid in O2/H2O environments. There are two reaction channels in formic acid pyrolysis: the dehydration reaction (HCOOH-*H2O+CO) and the decarboxylation reaction (HCOOH-*H2+CO2), with the dehydration reaction predominating, where the major pathway is HCOOH-*CHO-*CO. For the pyrolysis of acetic acid, the primary pathway involves the sequential steps: CH3COOH-*CH3-*CH3OH-*HCHO-*CO. The initial major reactions are CH3COOH-*CH3CO+OH, CH3CO-*CH3+CO, and CH3+OH-*CH3OH, followed by successive dehydrogenation reactions of CH3OH to form CO. During oxidation of formic acid, as the oxygen content increases, the production of H2 and CO decreases, while the production of H2O and CO2 increases. The watercatalyzed pyrolysis generates the most H2 by inhibiting dehydration and enhancing decarboxylation, with elevated temperatures further increasing the yield. H2 formation occurs through H-abstraction reactions on acids, H2O, and intermediate products by H radicals. Constructing reaction kinetic models for these processes. The decomposition activation energies are in good agreement with experimental data reported in the previous literature. The carboxyl group plays a more predominant role than the methyl group in the initial pyrolysis process.