Increasing in the scale and complexity of interconnected power systems was because of the growth of electricity demands, leading to multiple electromechanical oscillations despite having support of the power system stabilizer (PSS). Therefore, the dynamic performance of the existing networks should enhance. One type of flexible alternating current transmission system devices, namely the static var compensator (SVC), can be installed at the buses to maintain and/or control particular parameters of the electrical power system by exchanging capacitive and/or inductive current. However, the performance of SVC device highly depends upon its parameters, sizes, and suitable number and location in the power network. Hence, the optimal location for SVC has become a key issue; in this paper, we propose a novel approach for the suitable number and location for SVC by using critical energy analysis based on the Gramian matrices that the solution framework applied an algorithm based on the Lyapunov equations and the balanced realization technique. The optimal placement is determined by (1) analyzing the small-signal stability to seek number of feasible locations and (2) comparing these feasible locations by analyzing the transient stability through various simulation cases. The effectiveness of the proposed method is compared with the other optimal method and verified on the 39-bus New England system by the simulation results based on the power system simulation engineering (PSS/E) and MATLAB programs. The obtained result shows that the SVC is installed at the single or multi-location having the total maximum Gramian energy.