This document presents an optimization of laser welding parameters for martensitic stainless steel using a genetic algorithm. The algorithm aims to minimize the difference between the actual and desired weld size (width and depth) by optimizing laser power, welding speed, and fiber diameter. The genetic algorithm was run 10 times with a population of 30 over 200 iterations each time. The results showed errors between optimized and experimental values of less than 5% for the parameters. The study demonstrates that genetic algorithms can effectively optimize laser welding parameters to achieve a preset weld size.