Today, it has become imperative to design these systems at optimum size to make reliable and minimize the total costs of renewable energy systems. There are many studies about size optimization in the literature. However, few studies have approached the problem with a heuristic method at different levels of reliability and compared the results with commercial software. This paper aims to fill this gap by proposing an artificial bee colony (ABC) algorithm with different reliability ratios for renewable energy systems size optimization and comparing the results of the proposed method with the results of the HOMER Pro software.The current methodology is validated with a real case study on the load demand of a school building (latitude 41.37, longitude 27.3) in Turkey. The peak and average load per day for the school building are 7.4 kW and 51.8 kW, respectively.The proposed method has presented 14.71%, 14.36%, and 6.23%, respectively, more economical solutions than HOMER Pro software for hybrid photovoltaic (PV)/wind/battery, PV/battery, and wind/battery renewable energy system scenarios. In addition, the ABC algorithms with different reliability ratios (%0, %0.2, %1, and %3) are used to analyze the effect on the system cost of the loss of power supply probability. According to the results, the hybrid renewable energy system consisting of 230 PV panels, 6 wind turbines, and 34 batteries is the most economical option with a total annual cost of $42 717.58 compared to stand-alone systems with a reliability %0 ratio. It has been seen that increasing the loss of power supply probability reduces system costs. Consequently, this study shows that using the ABC algorithm in size optimization of renewable energy systems yields accelerates the decision-making process and more optimized solutions.