People often forgo their own self-interest to react to fairness and justice violations, even when not directly affected by the infraction. There are different ways to react to an injustice: some may prefer to punish the perpetrator, and others to compensate the victim. Here, our focus is on the role played by attention to determine these choices, investigating the relationship between attentional mechanisms and punishment/compensation in five preregistered experiments (N = 1157). Two eye-tracking experiments showed that people who focus more on the offender's payoff are more likely to punish, and when an exogenous stimulation increases the focus on the offender's payoff, people spend more to punish. An offender bias was also found, meaning that people, overall, prefer to focus on the offender's, rather than the victim's, payoff, and punish more than compensate. This was confirmed in three behavioural experiments, where people were exposed to either the offender's or the victim's payoff: when given the choice, people prefer to reveal the offender's payoff, and then punish; however, when randomly exposed to the victim's payoff, the preference for punishment disappears. Affective empathy boosts this effect: higher empathy leads to more punishment (or compensation) when the offender's (or victim's) payoff is revealed. These findings suggest that, whilst people have an intrinsic motivation to search for information that matches their preference (i.e., the offender's payoff and punishment), when exposed to an alternative piece of information (i.e., the victim's payoff), they modify their behaviour. Implications for understanding information bubbles and ways to overcome them are discussed.