The capacity of an active power filter(APF) is restricted by the withstanding capability of its converter, on the other hand, very few APFs consider the random characteristics of the harmonics, which causes inefficient usages and extra operation costs. Considering the stochastic characteristics of harmonics, the concept of M95is introduced to analyze the non-random components in harmonics. When the compensation target exceeds M95or deterministic components, M95or the deterministic component will be the actual compensation goal. And it will be the basis in determining the capacity of APF. The solution and application are also discussed when the capacity exceeds limits. This APF design method can ensure effectively take advantage of compensation capacity, therefore decrease the installation costs while still meet certain probability index requirements.