We conducted an experiment in which we hired workers under different types of contracts to evaluate how flexible working time affects on‐the‐job productivity in a routine job. Our approach breaks down the global impact on productivity into sorting and behavioural effects. We find that flexible arrangements that allow workers to decide when to start and stop working increase global productivity by as much as 50%, 40% of which is induced by sorting, and 60% represents a motivational effect, mainly driven by more effective working time, with workers reducing the length of their breaks. Our findings also suggest that part‐time contracts can enhance global productivity, – though not significant at conventional levels –, and that this effect is also driven by a significant drop in the length of breaks taken. We hence contribute to the literature providing causal evidence of flexibility in routine jobs leading to higher productivity.