This paper studies the effects of employment shocks on births and induced abortions. We are the first to show that abortions play a role in fertility responses to job displacement. Furthermore, we document precautionary fertility behavior: the anticipatory response of women to expected labor market shocks. Using individual-level administrative data from Hungary, we look at firm closures and mass layoffs as conditionally exogenous employment shocks in an event study design. After establishing that both shocks have a similarly large and persistent negative effect on employment and wages, we show that women already react to the anticipation of these shocks, and their fertility responses differ substantially for firm closures and mass layoffs. We find that abortions increase by 88% in the year before firm closures, while the number of births is not affected. Mass layoffs have no significant effect on abortions in the preceding year but increase the number of births by 44%. Mass layoffs and firm closures differ in one crucial aspect: pregnant women cannot be laid off until the firm exists, but no such dismissal protection is available in the case of firm closures. Thus, when dismissal protection is available, anticipated employment shocks increase the number of live births, whereas when it is not, they increase the number of abortions. These results suggest that dismissal protection has the potential to support women to keep pregnancies at times of economic shocks.