We use an online real-effort experiment to investigate how bonus-based pay and worker productivity interact with workplace cheating. Firms often use bonus-based compensation plans, such as group bonuses and firm-wide profit sharing, that induce considerable uncertainty in how much workers are paid. Exposing workers to a compensation scheme based on random bonuses makes them cheat more but has no effect on their productivity. We also find that more productive workers behave more dishonestly. We explain how these results suggest that workers' cheating behavior responds to the perceived fairness of their employer's compensation scheme.