In this paper a new method has been proposed to decide optimal placement and best sizing of static synchronous compensator (STATCOM). Seeking the best place is performed using the sensitivity analysis and sizing of STATCOM is managed using the genetic algorithm. The average model can account for the high-frequency effects and power electronic losses, and more accurately predict the active and reactive power outputs of the STATCOM. This paper employs the DIgSILENT simulator and the DPL as a programming tool of the DIgSILENT to show the validity of the proposed method. The effectiveness of suggested approach has been tested on part of the distribution network of Iran, Khoramdarreh city in Zanjan province.