Human social interaction is strongly shaped by other-regarding preferences, that is, a concern for the welfare of others. These preferences are important for a unique aspect of human sociality-large scale cooperation with genetic strangers-but little is known about their developmental roots. Here we show that young children's other-regarding preferences assume a particular form, inequality aversion that develops strongly between the ages of 3 and 8. At age 3-4, the overwhelming majority of children behave selfishly, whereas most children at age 7-8 prefer resource allocations that remove advantageous or disadvantageous inequality. Moreover, inequality aversion is strongly shaped by parochialism, a preference for favouring the members of one's own social group. These results indicate that human egalitarianism and parochialism have deep developmental roots, and the simultaneous emergence of altruistic sharing and parochialism during childhood is intriguing in view of recent evolutionary theories which predict that the same evolutionary process jointly drives both human altruism and parochialism.