Online reputation mechanisms are emerging as a promising alternative to more traditional mechanisms for promoting trust and cooperative behavior, such as legally enforceable contracts. As information technology dramatically reduces the cost of accumulating, processing, and disseminating consumer feedback, it is plausible to ask whether such mechanisms can provide an economically more efficient solution to a wide range of moral hazard settings where societies currently rely on the threat of litigation in order to induce cooperation. In this paper, we compare online reputation to legal enforcement as institutional mechanisms in terms of their ability to induce cooperative behavior and we explore the impact of information technology on their relative economic efficiency. We find that although both mechanisms result in losses relative to the maximum possible social surplus, under certain conditions online reputation outperforms litigation in terms of maximizing the total surplus, and thus the resulting social welfare.