The global pivot towards sustainable energy solutions necessitates a closer examination of green hydrogen production using renewable energy sources. This study aimed to assess the feasibility and efficiency of green hydrogen production on an industrial scale using solar and wind energy in Diyala city, Iraq. Experimental weather data, including solar irradiance, ambient temperature, and wind speed, were meticulously collected throughout 2022. The analysis indicated that, for wind energy, the optimum electrolyser capacity that matched a 1.5 MW wind turbine achieved a hydrogen production of 11,963 kg/year, with associated costs of $8.87/kg. In contrast, when focusing on solar energy, the ideal electrolyser capacity harmonizing with a 2 MW solar photovoltaic generated a notably higher hydrogen output of 94,432 kg/year at a more competitive cost of $6.33/kg. These findings underscore the potential economic advantages of solar-based green hydrogen production over wind-based methods in Diyala city. Furthermore, the significant difference in hydrogen production yields between the two methods emphasizes the need to optimize renewable infrastructure based on location-specific renewable resources. This study offers valuable insights into tailoring green hydrogen production strategies in regions with similar climatic conditions to Diyala and serves as a blueprint for future renewable energy-driven hydrogen production initiatives.