In silico evolution with an in vitro system can facilitate the development of functional aptamers with high specificity and affinity. Although a general technique known as systematic evolution of ligand by exponential enrichment (SELEX) is an efficient method for aptamer selection, it sometimes fails to identify aptamers with sufficient binding properties. We have previously developed in silico maturation (ISM) to improve functions of aptamers based on genetic algorithms. ISM represents an intelligent exploitation of a random search within a defined sequence space to optimize aptamer sequences and improve their function of interest. Here we demonstrated a successful application of ISM of aptamers to simultaneously improve specificity and affinity for Streptococcus mutans with discovery of a core sequence, which was required to form a polymerized guanine quadruplex structure for target binding. We applied ISM to aptamers selected by whole-cell SELEX and identified an aptamer with up to 16-fold improvement in affinity compared to its parent aptamers, and specificity was increased to show 12-fold more binding to S. mutans than to Lactobacillus acidophilus. Furthermore, we demonstrated a specific flow-through detection of S. mutans at a concentration range of 1 × 105–108 CFU/mL using the evolved aptamer immobilized on gold colloids. Biotechnol. Bioeng. 2014;111: 454–461. © 2013 Wiley Periodicals, Inc.