Modeling magnetic components for simulation in electric circuits requires an accurate model of the hysteresis loop of the core material used. It is important that the parameters extracted for the hysteresis model be optimized across the range of operating conditions that may occur in circuit simulation. This paper shows how to extract optimal parameters for the Jiles-Atherton model of hysteresis by the genetic algorithm approach. It compares performance with the well-known simulated annealing method and demonstrates that improved results may be obtained with the genetic algorithm. It also shows that a combination of the genetic algorithm and the simulated annealing method can provide an even more accurate solution that either method on its own. A statistical analysis shows that the optimization obtained by the genetic algorithm is better on average, not just on a one-off test basis. The paper introduces and applies the concept of simultaneous optimization for major and minor hysteresis loops to ensure accurate model optimization over a wide variety of operating conditions. It proposes a modification to the Jiles-Atherton model to allow improved accuracy in the modeling of the major loop.