The invention relates to a laser marking machine with an anti-glare function. The laser marking machine comprises a base, a processing table, a supporting pillar, a transverse plate, a laser transmitter, two drying mechanisms and four light blocking mechanisms, each light blocking mechanism comprises a fixed block, a rotary block, a light blocking assembly and a cleaning assembly; each light blocking assembly comprises a first motor, a gear, a rack, a light barrier and a limiting groove; each cleaning assembly comprises a cleaning unit and a treatment unit; each cleaning unit comprises an airpump, a cylinder barrel, a piston rod and a cleaning block; each drying mechanism comprises a vertical plate, a swinging component and an air blower. The laser marking machine with the anti-glare function can block reflected light by means of the light blocking mechanisms so as to avoid the damage, caused by the reflected light, to human eyes, so that the safety of the laser marking machine is improved; the drying mechanisms are used for spraying hot air onto the laser transmitter, so that the situation that the use of the laser marking machine is influenced by the phenomenon of moisture condensation of eyeglasses can be avoided, and the convenience of the laser marking machine is further improved.