This paper develops a model of intrahousehold allocation with endogenous fertility, which captures the relationship between birth order and investment in children. It shows that a birth order effect in intrahouse hold allocation can arise even without assumptions about parental preferences for specific birth orders of children or genetic endowments varying by birth order. The important contribution is that fertility is treated as endogenous, a possibility that other models of intrahousehold allocation have ignored. The implications of the model are that children with higher birth orders (that is, who are born later) have an advantage over siblings with lower birth orders, and that parents who are inequality-averse will not have more than one child. The model furthermore shows that not taking account of the endogeneity of fertility when analyzing intrahousehold allocation may seriously bias the results. The effects of a child's birth order on its human capital accumulation are analyzed using a longitudinal data set from the Philippines that covers a very long period. We examine the effects of birth order on both number of hours in school during education and completed education. The results for both are consistent with the predictions of the model.