A method for obtaining a detergent for cleaning metal surfaces, which includes the operations of loading into the reactor a calculated amount of surfactants and solutions of alkali metal salts, the operations are carried out with constant heating and stirring of the reaction mixture, according to the invention, heating is carried out up to 35 °C, a mixture of non-ionic dispersing (0.10-0.35 % wt. in the detergent) and emulsifying (0.05-0.15 % wt. in the detergent) surfactants, and potassium hydroxide (0.15-0.30 % wt. in the detergent) and potassium bichromate (0.01-0.05 % wt. in the detergent) are used as alkali metal salts.