The paper formalizes the pervasive phenomenon of the self-serving bias within the framework of reference dependent preferences. This formulation allows to state a simple rule to assess the existence of the bias at the aggregate level as well as a procedure that identifies the minimum number of biased agents. As an application, we study the problem of the optimal allocation of a scarce resource among a finite number of claimants. We analyze the performance of different welfare criteria and show how the existence of self-serving biased individuals exacerbates the conflict between equity and efficiency of the final allocation.