A particle swarm optimization (PSO) approach for finding the optimal size and location of capacitors is reported in this work. The proposed technique finds optimal locations for shunt capacitors from the daily load curve. In addition, it determines the suitable values of fixed and switched capacitors. A dynamic sensitivity analysis method is used to select the candidate installation locations of the capacitors to reduce the search space of this problem. In case of more than one location, the dynamic sensitivity helps in deciding other locations considering the effect of previously decided locations and values of capacitors. A simple iterative method is used to compute the power flow. The results obtained for well studied 70-bus and 135-bus systems are compared with the solutions obtained by Tabu Search (TS), Hybrid and Genetic Algorithm. It is demonstrated that the proposed PSO approach offers the global optimal solution with greater saving.