We develop an experimental test to distinguish between discrimination against and nepotism. The experiment compares the behavior toward individuals of different groups with the behavior toward anonymous individuals (those having no clear group affiliation). Not only is the distinction between the different types of discrimination important for the study of social segmentation, but it has interesting policy implications regarding the effectiveness and the efficiency of antidiscriminatory legislation. We study two segmented societies: Belgian (Flemish versus Walloons) and Israeli (religious versus secular). In Belgium, we find evidence of discrimination. Both the Walloons and the Flemish treat people of their own group in the same way as anonymous individuals while discriminating against individuals of the other group. In contrast, the behavior of ultraorthodox religious Jews in Israel can be categorized as nepotism: they favor members of their own group while treating anonymous individuals in the same way as secular individuals.