The invention provides a front end interface code generating method, and belongs to the technical field of computers. The front end interface code generating method solves the problems existing in a front end interface generating method in the prior art that a generated code is low in accuracy, and the developing efficiency is low. The method comprises the steps of obtaining position information of a control included in source data exported by a design file of a front end interface, then based on the position information of the control, through the mode of simulating the layout or iteration ofthe control in a container, determining the layout scheme of the control, and finally, according to the layout scheme, generating the code of the front end interface. By means of the method, by obtaining the position information of the control included in the source data exported by the design file of the front end interface, control data is fully reserved, and the accuracy of the generated codecan be effectively improved; according to the position information of the control, the layout scheme of the control is automatically determined, a standard layout template does not need to be manuallyinput, the efficiency of generating the code of the front end interface is improved, and meanwhile, the generated layout code is higher in flexibility.