The invention provides a nonaqueous electronic cleaning agent and a preparation method thereof. The electronic cleaning agent comprises the following components: citrus oil, acetyl tributyl citrate, calcium stearoyl lactylate, potassium silicate, sodium alginate, sorbitol, dibasic lead stearate, sodium carbonate, sodium citrate, TBHQ, sodium dehydroacetate, ethanol and water. The preparation method comprises the following steps: mixing TBHQ, acetyl tributyl citrate and ethanol to obtain a solution A; mixing citrus oil, calcium stearoyl lactylate, potassium silicate, sodium alginate, sorbitol, dibasic lead stearate, sodium carbonate, sodium citrate, sodium dehydroacetate and water, heating, and stirring to obtain a solution B; adding the solution A after the solution B is cooled, and uniformly stirring to obtain the product. The cleaning agent is high in cleaning efficiency, does not corrode electronic equipment, has no harm to the human body, is easy to degrade, and has no pollution to environment; the preparation method is simple, easy to control, easy for industrialized production and low in production cost.