Magnesium hydride (MGH), a highly promising hydrogen-producing substance/additive for hydrogen production through its hydrolysis reaction, has the potential to enhance broiler production. However, before incorporating MGH as a hydrogen-producing additive in broiler feed, it is crucial to fully understand its impact on microbiota and metabolites. In vitro fermentation models provide a fast, reproducible, and direct assessment tool for microbiota metabolism and composition. This study aims to investigate the effects of MGH and coated-magnesium hydride (CMG) on fermentation characteristics, as well as the microbiota and metabolome in the culture of in vitro fermentation using cecal inocula from broilers. After 48 h of incubation, it was observed that the presence of MGH had a significant impact on various factors. Specifically, the content of N-NH3 decreased, while the total hydrogen gas and total SCFAs increased. Furthermore, the presence of MGH promoted the abundance of SCFA-producing bacteria such as Ruminococcus, Blautia, Coprobacillus, and Dysgonomonas. On the other hand, the presence of CMG led to an increase in the concentration of lactic acid, acetic acid, and valeric acid. Additionally, CMG affected the diversity of microbiota in the culture, resulting in an enrichment of the relative abundance of Firmicutes, as well as genera of Lactobacillus, Coprococcus, and Eubacterium. Conversely, the relative abundance of the phylum Proteobacteria and pathogenic bacteria Shigella decreased. Metabolome analysis revealed that MGH and CMG treatment caused significant changes in 21 co-regulated metabolites, primarily associated with lipid, amino acid, benzenoids, and organooxygen compounds. Importantly, joint correlation analysis revealed that MGH or CMG treatments had a direct impact on the microbiota, which in turn indirectly influenced metabolites in the culture. In summary, the results of this study suggested that both MGH and coated-MGH have similar yet distinct positive effects on the microbiota and metabolites of the broiler cecal in an in vitro fermentation model.