In this paper, controlling and optimizing against the earthquake by using genetic algorithm is investigated. In this paper, a new approach for selecting optimal accelerograph and scaling them for dynamic time history analysis is presented by the binary genetic algorithm and natural numbers, in order to achieve the mean response spectrum, which has a proper matching and a short distance with the target spectrum and indicates the expected earthquake of the site. Because of the difference in the nature of accelerograph and the scale coefficients, the genetic algorithm presented in this paper, is hybrid (has two chromosomes). The proposed algorithm is capable of constructing a new generation of people from a series of infinitesimal earth movement records, in a process where natural selection, mating, mutation takes place, and creates a new generation of people and continues this process until a person with desirable qualities is obtained. One of the most important factors in the accuracy and efficiency of these programs is the correct estimation of their parameters. If these parameters are correctly calculated, the difference between the mean response spectrum and the spectrum of the plot will be greatly reduced. Due to the relatively large number of these parameters, the use of trial and error-based methods largely relies on user skills, the proposed hybrid genetic algorithm program can overcome this defect. The program has two genomes that run simultaneously and provide close answers to the optimal answer. The program itself is able to provide the user with a range of optimal coefficients and crossing values and mutations of each chromosome.