This paper studies the effect of subjective beliefs about HIV infection on fertility decisions in a context of high HIV prevalence and simulates the impact of different policy interventions, such as HIV testing programs and prevention of mother-to-child transmission, on fertility and child mortality. It develops a model of women's life-cycle, in which women make sequential fertility decisions. Expectations about the life horizon and child survival depend on women's perceived exposure to HIV infection, which is allowed to differ from the actual exposure. In the model, women form beliefs about their HIV status and about their own and their children's survival in future periods. Women update their beliefs with survival to each additional period as well as when their HIV status is revealed by an HIV test. Model parameters are estimated by maximum likelihood with longitudinal data from the Malawi Diffusion and Ideational Change Project, which contain family rosters, information on HIV testing, and measures of subjective beliefs about own HIV status. The model successfully fits the fertility patterns in the data, as well as the distribution of reported beliefs about own HIV status. The analysis uses the model to assess the effect of HIV on fertility by simulating behavior in an environment without HIV. The results show that the presence of HIV reduces the average number of births a woman has during her life-cycle by 0.15. The paper also finds that HIV testing can reduce the fertility of infected women, leading to a reduction of child mortality and orphan-hood.