AbstractBiomass energy is a renewable energy source that is carbon‐neutral, versatile, and can never go extinct. In the current study, a simulation model of an anaerobic digester with parameters such as pretreatment temperature (PTT), hydraulic retention time (HRT), and feed‐to‐water (F/W) ratio was developed and a design of experiment was created. The results showed that the higher hemicellulose content in sugarcane bagasse (SB) gave a decent H2 yield (13–23 %). The significance sequence was PTT > F/W > HRT. The optimal values were HRT of 15–16 d; F/W of 1.5 (SB), 1.26 [rice straw (RS)], and 0.5 [sawdust (SD)]; and PTT of 63.3 (SB), 68.8 (RS), and 75 °C (SD). The optimal H2 yield was 19.80 (SB), 20.94 (RS), and 21.41 % (SD). Therefore, the present simulation and optimization showed concrete results to raise H2 yield.