Linguistic communication relies on pragmatic implicatures such as the inference that if "some students passed the test," not all did. Yet young children perform poorly on tests of implicature, especially scalar implicatures using "some" and "all," until quite late in development. We investigate the origins of scalar implicature using tasks in which the scale arises from real-world context rather than conventional contrasts between lexical items. Experiment 1 shows that these ad-hoc implicatures are easy for preschool children, suggesting that children have an early competence at pragmatic inference, and that failures in standard scalar implicature tasks are due instead to problems contrasting lexical items. Experiments 2 and 3 compare a Gricean, counterfactual account of implicature with a linguistic alternatives account and find that neither predicts effects of contextual informativeness. We conclude that an account of pragmatic implicature must integrate world knowledge, linguistic structure, and social reasoning.