We exploit a natural experiment to study discrimination in elections. In Illinois Republican presidential primaries, voters vote for delegates bound to presidential candidates, but delegates' names convey information about their race and gender. We identify discrimination from variation in vote totals among delegates bound to the same presidential candidate and who face the same voters. Examining delegate vote totals from 2000 to 2016, we estimate nonwhite delegates receive 9% fewer votes. We find essentially no gender discrimination. Negligible incentives for statistical discrimination, costs to preferred presidential candidates, and heterogeneity are consistent with an interpretation of this behavior as taste-based.