Social media rapidly disseminates political opinions and information, serving as a cornerstone of democratic participation. In these online spaces, anonymity can protect free expression, but it may also facilitate hate speech by lowering the social and reputational costs of norm violations. Our study examines how reducing anonymity may shape different forms of prejudiced expression in unequal ways. To explore how anonymity shapes xenophobia and misogyny in online political discussions, we combine quantitative text analysis using fine-tuned BERT models with a difference-in-differences design. We show that reduced anonymity decreases xenophobia but has no comparable effect on misogyny. Moreover, the responsiveness to xenophobic hate speech after a reduction in anonymity seems to stem from individuals with a history of extensive xenophobic writing. Through our exploration, we argue that anonymity’s influence depends on the social and reputational costs associated with the various forms of prejudice. The study also demonstrates the value of combining computational text analysis with quasi-experimental methods to study heterogeneous forms of online hate.