Nowadays, the world energy production is still based on the exploitation of fossil fuels, mainly oil, coal, and natural gas, responsible for large greenhouse emissions in the environment. According to the measures proposed by the European Green Deal to meet the carbon neutrality by 2050, the decarbonisation of the global energy production processes represents a top priority. Hydrogen represents a carbon-free energy carrier, useful to drive the society toward a decarbonized-economy. The novelty of this work is represented by the experimental generation of clean hydrogen by a two stages plant constituted of a biogas/biomethane steam reformer and a Pd-Ag membrane separator, meanwhile applying on this simple case the methodology of the exergy analysis, identifying the main losses and suggesting improvements. Hence, it deals with the exergy analysis of the whole system with the process intensification operated by the membrane separator adopted instead of using several stages to separate/purify hydrogen − as conventionally done after the reforming stage (two water gas shift reactors, high and low temperature, followed by a pressure swing adsorption stage) − with the objective of recovering decarbonized hydrogen coming from the biogas/biomethane steam reformer, meeting the European targets indicated by the Clean Hydrogen Alliance. This approach allowed to understand the amount of irreversibilities present in such a system as well as how the thermal efficiency may be influenced by a number of parameters, constituting globally a baseline for the scaling up of this process technology from lab to bench/pilot scale. The best results of this work highlight that the utilization of biomethane in the feed stream to generate hydrogen resulted to be a better choice than biogas in terms of thermal efficiency (based on the lower heating value) of the whole system, equal to 73 % at 773 K, while the highest percentage of exergy destruction was concentrated in the condensation stage, with values varying between 76 % and 93 %, depending on the feed stream typology. The two stages system was able to meet the “decarbonized hydrogen production target 2027”, with a hydrogen recovery of 90 % and a purity of 99.9999 %. Last but not least, the overall exergy destroyed efficiency of the overall system in the two analyzed cases was 92 % (biomethane feed stream) and 88 % (biogas feed stream), respectively.