The presence of a nonlinear load connected to the power supply network causes a distortion of the sinusoidal shape of the current and voltage curves, resulting in higher harmonics. Higher harmonics lead to overloading and overheating of equipment, reduced reliability and reduced service life, and can have a negative impact on the quality of electricity. As part of the task of ensuring the reliability of power grids, an important task is to control the level of harmonic components and use special devices to minimize their impact. To combat higher harmonics in power grids, various devices have been developed and used, including line chokes, passive filters, and active filters. The choice of a particular device depends on the parameters of the power grid, the type and characteristics of the connected load, the level of harmonic components, and the requirements for the quality of electricity. Linear chokes are capable of reducing the level of harmonics in the power grid, but, having a number of disadvantages, require additional justification when deciding on their use. A passive filter has a circuit consisting of a choke, resistor, and capacitor, can have different configurations, and is tuned to the frequency of a specific harmonic to suppress its effects. Passive filters are more effective in combating higher harmonics generated by nonlinear noise, more economical and easier to maintain, but have a limited frequency range, fixed parameters and significant weight and dimensions, which limits their use. Active filters include active components to generate signals that are out of phase with harmonic components, thus compensating for higher harmonics. Active filters are more flexible, capable of correcting distorted and shaped signals, are much more efficient than chokes and passive filters, but are less cost-effective and more power-consuming. In the presented work, a passive six-link LC filter and a shunt active filter based on the principle of instantaneous compensation of active and reactive currents are investigated. In the active filter, harmonic distortion compensation is provided by a proportional-integral controller. In this paper, we have carried out simulation modeling of passive and active filters as part of an electrical complex for metal heat treatment and analyzed the results of harmonic distortion compensation