We investigate how sexism and harassment affect political candidates’ preferences for political positions by deploying a conjoint experiment among political candidates in the 2021 Danish local elections. We find that, compared to men candidates, women candidates experience far more sexism and harassment, and assess their risk of victimization as being far higher. Correspondingly, the conjoint experiment reveals that women candidates state stronger preferences for equal working environments in politics than men, while holding similar preferences for formal working conditions like political positions, remuneration, and workload. Substantively, women’s willingness to lower their remuneration and increase their workload to avoid sexism in politics is more than double the size of men’s willingness. Our approach provides us with highly accurate descriptions of candidates’ preferences for political jobs, which are often assumed rather than measured directly. This lets us quantify the magnitude of an important working condition in politics with significant repercussions for women.