The invention discloses halogen-free flame retardant polyester with the laser marking function and a preparation method thereof. The polyester provided by the invention comprises the following components in percentage by weight: 25-75% of polyester resin, 0-50% of alkali-free glass fiber, 10-35% of halogen-free flame retardant agent, 0.3-5% of laser marking agent, 0-20% of toughening agent, 0.5-1% of acid absorbing agent, 0.3-0.5% of oxidation resisting agent, 0.5-5% of coloring agent and 0.5-5% of processing aid. The invention also provides a preparation method of the halogen-free flame retardant polyester with the laser marking function, which comprises the following steps of: after uniformly mixing all the components according to the ratio, delivering the mixture into a double-screw extruder, and carrying out melting, mixing, extruding, strip stretching, cooling, drying and granulating the mixture through the extruder to obtain granules. The polyester provided by the invention has excellent electrical properties and mechanical properties, various colors and good laser marking effect. The preparation method provided by invention is simple and is applicable to continuous large-scale production.