In this study, comprehensive thermodynamic analysis and techno-economic assessment studies of the renewable hydrogen production and its blending with natural gas in the existing pipelines are performed. Solar and wind energy-based on-grid and off-grid power systems are designed and compared in energy, exergy, and cost. Solar PV panels and wind turbines are particularly considered for electricity and hydrogen production for residential applications in an environmentally benign way. Fuel cell units are included to supply continuous electricity in the off-grid system. Here, the heat required for a community consisting of 100 houses is provided by hydrogen and natural gas mixture as a more environmentally benign fuel. The costs of capital, fuel, operation, and maintenance are calculated and evaluated in detail. The total net present costs are calculated as $6.95 million and $2.47 million for the off-grid and on-grid power systems, respectively. For the off-grid system, energy and exergy efficiencies are calculated as 32.64% and 40.73%, respectively. Finally, the energy and exergy efficiencies of the on-grid system are determined as 26.58% and 35.25%, respectively. (C) 2022 Hydrogen Energy Publications LLC. Published by Elsevier Ltd. All rights reserved.