A main driver of the gender wage gap is that women earn a lower firm-specific wage premium than men. We document the role of flexible wage components in driving both within-firm and between-firm gender differences in firm premia. For this purpose, we link wage survey data on performance payments and overtime to an administrative linked employer-employee dataset from Hungary. We find that the gender gap in firm premia is negligible at firms that do not pay either performance payments or overtime, while it is more than 11 percent at firms where all employees receive performance- and overtime payments. These patterns are also present when we control for differences in the labor productivity of firms or after composition differences are accounted for using AKM models. Finally, a decomposition exercise shows that performance payments and overtime payments contribute 60 percent to the gender gap in firm premia and 25 percent to the overall gender gap.