Distributed generator (DG) resources are small scale electric power generating plants that can provide power to homes, businesses or industrial facilities in distribution systems. Power loss reductions, voltage profile improvement and increasing reliability are some advantages of DG units. The above benefits can be achieved by optimal placement of DGs. Whale optimization algorithm (WOA), a novel metaheuristic algorithm, is used to determine the optimal DG size. WOA is modeled based on the unique hunting behavior of humpback whales. The WOA is evaluated on IEEE 15, 33, 69 and 85-bus test systems. WOA was compared with different types of DGs and other evolutionary algorithms. When compared with voltage sensitivity index method, WOA and index vector methods gives better results. From the analysis best results have been achieved from type III DG operating at 0.9 pf.