The present research study presents the optimization of Solid Oxide Fuel Cell (SOFC) power plants directly fed by biogas. By considering energy and exergy balances for such a system, a detailed thermodynamic model (THERMAS) was designed and implemented. A specific SOFC-based system was selected as case study, equipped with three heat exchangers (preheaters), a reformer, a SOFC-stack system and an afterburner. The use of the simulation tool THERMAS give us the opportunity to investigate all the appropriate parameters that affect system's efficiency based on exergy analysis while incorporating a detailed parametric analysis regarding the whole system. The optimization process relies on the difference between the energy and exergy efficiency by considering an innovative Optimization Factor (OPF) for each simulated system, which is dynamically affected by operational parameters, such as fuel composition, extension of chemical reactions and temperatures. It is found that the use of a pure fuels seems to be meaningless without optimization. (C) 2017 Elsevier Ltd. All rights reserved.