Human cooperation depends on individuals caring about their reputation, and so they sometimes attempt to manage them strategically. Here we show that even 5-year-old children strategically manage their reputation. In an experimental setting, children shared significantly more resources with an anonymous recipient when (1) the child watching them could reciprocate later, and (2) the child watching them was an ingroup rather than an outgroup member (as established by minimal group markers). This study is not only the first to show that young children selectively invest in their reputation with specific individuals, but also the first to show that we care more about our reputation with ingroup than with outgroup members.