In this article, an algorithm is proposed and used to study the influence of harmonics on the behavior of medium‐voltage underground cables in flat formation. The proposed algorithm is a thermal model based on the heat equilibrium of the thermal circuit nodes of the medium‐voltage cable system. The impact of harmonics on the temperature rise of the cable elements and the cable capacity is evaluated in this article. Also, the impact of harmonics on the derating factors of cable for different soil types is presented. Finally, the measurement of temperatures of cable cores is carried out experimentally and compared with the calculated results to validate the proposed algorithm. One of the algorithm merits is that several harmonic percentages can be taken into account for each cable phase individually, and the heat exchange between the cable phases and their sheath is also taken into consideration. From the obtained results, it is illustrated that the presence of harmonics has a remarkable influence on the cable core temperature; mainly, harmonics of the third and fifth orders may lead to dry zone formation around the cable. It is also observed that the presence of harmonics has an important influence on the cable current, especially when it is buried in soil that has high thermal resistivity during the summer season (suction tension = ∞). In summer, the cable core temperature reached 152.162°C, 139.053°C, and 133.375°C when lime, sand, and silty sand, respectively, are used as backfill materials, rather than 90°C in the normal operating condition of the 11 kV three‐phase single‐core cable. It is observed also that with the increase of the soil thermal resistivity, the ratio of /) reached about 1.2 times at 2.5 K m/W soil thermal resistivity. In addition, it is also observed that the impact of harmonics leads to a percentage reduction in the derating factor of the cable center phase by 11.88%–12.37% depending on the composition of the backfill materials.