Recombinant adeno-associated viruses (rAAVs) are commonly used vehicles for in vivo gene transfer. However, the tropism repertoire of naturally occurring AAVs is limited, prompting a search for novel AAV capsids with desired characteristics. Here we describe a capsid selection method, called Cre recombination-based AAV targeted evolution (CREATE), that enables the development of AAV capsids that more efficiently transduce defined Cre-expressing cell populations in vivo. We use CREATE to generate AAV variants that efficiently and widely transduce the adult mouse central nervous system (CNS) after intravenous injection. One variant, AAV-PHP.B, transfers genes throughout the CNS with an efficiency that is at least 40-fold greater than that of the current standard, AAV9 (refs. 14,15,16,17), and transduces the majority of astrocytes and neurons across multiple CNS regions. In vitro, it transduces human neurons and astrocytes more efficiently than does AAV9, demonstrating the potential of CREATE to produce customized AAV vectors for biomedical applications.