The paper presents an algorithm for modeling nonlinear loads connected to the nodes of HV network. Models of nonlinear loads are necessary for analysis of harmonic modes in networks. The model is a set of active and reactive currents of various harmonics, obtained on the basis of the results of measurements of harmonic parameters in the node of connection of nonlinear load to the network. The paper presents the results of the analysis on measured parameters of harmonic modes at nodes of HV network. The analysis shows that the harmonic parameters vary randomly. The algorithm takes into account the probabilistic properties of harmonic currents. It allows the development of models of harmonic currents whose histogram shapes correspond to known probability density functions, and also represent their mixtures. The algorithm is illustrated with an example of modeling the nonlinear loads of a railway traction substation and an aluminum smelter block.