Humans have an intuitive sense of how to help and inform others even in the absence of a specific request. How do we achieve this? Here we propose that even young children can reason about others’ expected costs and rewards to flexibly decide what is best for others. We asked children to choose one of two toys to teach to another agent while systematically varying the relative costs and rewards of discovering each toy’s functions. Children’s choices were consistent with the predictions of a computational model that maximizes others’ utilities by minimizing their expected costs and maximizing their expected rewards. These results suggest that even early in life, children draw rational inferences about others’ costs and benefits, and choose to communicate information that maximizes their utilities.