This study examines the ethnic identity of authors in over 2.5 million scientific papers written by US-based authors from 1985 to 2008, a period in which the frequency of English and European names among authors fell relative to the frequency of names from China and other developing countries. We find that persons of similar ethnicity co-author together more frequently than predicted by their proportion among authors. Using a measure of homophily for individual papers, we find that greater homophily is associated with publication in lower impact journals and with fewer citations, even holding fixed the authors' previous publishing performance. By contrast, papers with authors in more locations and with longer reference lists get published in higher impact journals and receive more citations than others. These findings suggest that diversity in inputs by author ethnicity, location, and references leads to greater contributions to science as measured by impact factors and citations.