The primary objective of the proposed paper is to conduct a techno-economic study of an off-grid PV/Biomass hybrid system. We employed various optimization techniques. This included the Flower Pollination Algorithm (FPA), the Harmony Search (HS) algorithm, the Artificial Bee Colony (ABC) Algorithm and the Firefly Algorithm (FA). The ultimate objective was to determine an optimal solution for the sizing problem. In this context, the proposed procedure optimally selects the capacity of three types of generators, namely solar PV, biomass, and battery banks. The data for this study was collected from Monshaet Taher village, located in Egypt. To improve the performance, we restrained the selection between these generators to be based on minimizing the Net Present Cost (NPC) for a specified Loss of Power Supply Probability (LPSP) and Percentage of the excess energy (EXC). Three different battery technologies, including Flooded lead-acid (FLA), Lithium Ferro Phosphate (LFP) and Nickel Iron (Ni-Fe) have been considered in this study. The simulation results show that the Firefly Algorithm has the minimum execution time and best performance among the other algorithms, it also shows that the optimal configuration is obtained for a system comprising of 24 PV panels, 4 biomass power systems, and 298 Ni-Fe batteries.