For the fulfillment of global energy demand, the best options are renewable energy sources due to their ease of availability and non-polluting nature. Hybrid system improves the efficiency of the overall system and provides better balance in energy supply. This study proposes a hybrid bat–dragonfly algorithm for providing optimal power flow in the wind–solar system by tuning the controller parameters. Bat algorithm has the featureless computing time with low accuracy, and dragonfly algorithm has the feature of high accuracy with more computing time. The accuracy of the controller tuning gets improved with less computational time by integrating the operations of both bat and dragonfly algorithms. Fuzzy rationale–based maximum power point tracking extracts the maximum power available in wind–solar system. The results show that the proposed hybrid algorithm provides better execution in the tuning of controller parameters compared with the existing optimization methods with a low level of total harmonic distortion. Furthermore, the proposed hybrid bat–dragonfly algorithm outperforms the benchmark optimization algorithms when tested.