In the present paper by the use of the Monte Carlo method, an optimal selection of components for a hydraulic excavator swinging mechanism has been made. Three objective functions are defined – the total mass of the components “hydraulic motor”, “gearbox”, “slewing bearing” and “small sprocket”, as well as the product of the total price and the total mass and the price of the same components. By computation of the objective function for multiple random combinations of the components and subsequent ranking of the objective function values, an optimal combination of the components is selected. A major advantage of the method is that it is suitable for computer realization and the number of required calculations is relatively small. Another advantage is that by the objective function value rankings close to the optimal additional combinations are obtained, which significantly extends the design possibilities.