Although large ground motion databases are widely available today, in many occasions, the selection of ground motion records still hampers the use of nonlinear response history analysis in seismic engineering practice. This paper presents a novel optimization-based tool for creating subsets of ground motion records extracted from large databases. Existing heuristic methods select and/or scale ground motion records so that their mean spectrum fits a target spectrum, while methods that also consider the variability have been proposed. The paper presents a new and simple approach that selects and, if necessary, scales the ground motion records so that both their mean and variability optimally fit a target spectrum. The proposed approach is a multiobjective optimization methodology that can be solved quickly and efficiently with an evolutionary optimization algorithm. Contrary to other approaches, a Monte Carlo step is not required, while the proposed procedure is easy to implement and able to quickly search large databases. Furthermore, among the suite of optimum solutions (Pareto front) obtained, a criterion for choosing the most suitable design is proposed. The efficiency of the proposed tool is demonstrated with two numerical examples. In the first example, the target spectrum is a uniform hazard spectrum, while in the second example, a conditional mean spectrum (CMS) is adopted instead.