We present development of a genetic algorithm for fitting potential energy curves of diatomic molecules to experimental data. Our approach does not involve any functional form for fitting, which makes it a general fitting procedure. In particular, it takes in a guess potential, perhaps from an abinitio calculation, along with experimental measurements of vibrational binding energies, rotational constants, and their experimental uncertainties. The fitting procedure is able to modify the guess potential until it converges to better than 1% uncertainty, as measured by χˉ2. We present the details of this technique along with a comparison of potentials calculated by our genetic algorithm and the state of the art fitting techniques based on inverted perturbation approach for the X1Σ+ and C1Σ+ potentials of lithium-rubidium.