Abstract Children's altruism toward parents is allowed in a two-overlapping-generations model with endogenous fertility. Parents raise children because, when retired, they expect gifts from their children who are essentially a capital good. Individuals' behavior between generations is examined by analyzing a Nash equilibrium, which is then compared with a social planner's optimal allocation. The pay-as-you-go public pension program is viewed as the optimal gifts from the optimal allocation when the latter is implemented. The effect on fertility of the introduction of a capital market is also analyzed. The validity of the old-age security hypothesis is shown to depend on the parameters of utility and cost functions.