Realistic computational models of single neurons require component ion channels that reproduce experimental findings. Here, a topology-mutating genetic algorithm that searches for the best state diagram and transition-rate parameters to model macroscopic ion-channel behavior is described. Important features of the algorithm include a topology-altering strategy, automatic satisfaction of equilibrium constraints (microscopic reversibility), and multiple-protocol fitting using sequential goal programming rather than explicit weighting. Application of this genetic algorithm to design a sodium-channel model exhibiting both fast and prolonged inactivation yields a six-state model that produces realistic activity-dependent attenuation of action-potential backpropagation in current-clamp simulations of a CA1 pyramidal neuron.