Abstract. The significant problem of compensator placement and sizing in electrical networks has been analyzed in the paper. The compensation is usually realized by means of passive or active power filters. The former solution is widely used mainly because of the economical reasons, but the latter one becomes more and more popular as the number of nonlinear loads increases. Regardless of the compensator type the most important goal consists in voltage and current distortion drop below levels imposed by standards. Nevertheless, the desired effects should be achieved with the minimum cost. So far a few objective functions have been proposed for this optimization problem. It is claimed that minimization of the compensator currents leads also to the minimum costs. This paper shows that such simplified approach could lead to suboptimal solutions and in fact a function g(·) reflecting the relation between the compensator size and its price must be incorporated into objective functions. Moreover, in this case it is very easy to compare solutions obtained using compensators offered by different suppliers -it is enough to change the function g(·). Theoretical considerations have been illustrated by an example of active power filter allocation and sizing.