This work presents a method for optimal sizing of a battery-based energy storage system (BESS) in a droop controlled islanded microgrid (DCIMG). The proposed method checks the economic feasibility of installing a given battery unit and finds the optimal size of BESS which minimizes the running cost. The optimal sizing problem is successfully integrated into the economic dispatch (ED) problem and solved for various cases considering inductive and resistive coupled droop controlled distributed generation (DG) units. A new heuristic method is proposed for optimal charging of battery units. The proposed method is compared with the Dynamic Programming (DP) method. Both algorithms use incremental cost data. The proposed method is applied to a 33 node system. The results show an almost linear relationship between the optimal size and efficiency of the BESS. The results also show that the BESS absorbed most of the load variation and the dispatchable DG units experienced fewer load changes. Installation of BESS resulted in a significant reduction in operating cost of the DCIMG.