Statistical discrimination relies on people inferring unobservable characteristics of group members based on their beliefs about the group. Across four pre-registered experiments (𝑁 = 9,002), we show that accurate information about the composition of top performers can induce incorrect beliefs about performance differences across groups when the groups are of unequal size. Because people fail to account for base rates, they underestimate the performance of individuals from smaller groups. As a result, when participants in our experiments receive true information about the gender composition of top performers in a male-dominated candidate pool, they are less likely to hire women, even when there are no gender differences in performance (Study 1). Similarly, they are less likely to hire better-performing non-White candidates when the racial demographics of the candidate pool reflect the US population (Study 4). We show that these choices reflect an error in statistical reasoning, rather than being motivated by a desire to discriminate against any particular group (Study 2). Despite leading to less accurate beliefs, participants disproportionately seek out information about top performers when given the choice, and discrimination thus persists when information selection is endogenous (Study 3).