Human beings have entered an era in which all things can be counted.The algorithm is the administrative basis in the digital age,and the administration by algorithm is the inevitable result of the development of the era.Due to the advantages of high efficiency,accuracy,automation and justice,the algorithm has many applications in various fields of society,and it is necessary to transform from legal administration to algorithmic administration.In addition to the advantages of the algorithm itself,legal norms are similar to the algorithm rules in clarity,conciseness,abstractness and standardization,and have the possibility of transforming law into algorithm.From the angle of the connection between law and algorithm,we should further improve the formulation technology of legal norms and make them suitable for the conversion to algorithm;perfect the conversion mechanism and accurately convert legal norms into algorithmic rules;endow the legitimacy of algorithmic administration and realize the smooth transformation from administration according to law to administration according to algorithm.