Sporophytes are predicted to produce spores of a size that maximizes the return in gametophyte fitness per unit investment. Larger spores are predicted for those species in which gametophytes depend on stored food reserves for successful reproduction. A model for the origin of heterospory is proposed, in which an initially homosporous population is subject to natural selection for increased spore size. Because the minimum costs of male reproduction are less than the minimum costs of female reproduction, larger food reserves evolve principally for the use of female reproduction. Above some critical spore size, the population can be invaded by sporophytes producing smaller spores, which reproduce predominantly as males. This model for the origin of heterospory has three phases: (1) a gradual increase of spore size in a homosporous population; (2) the sudden introduction of smaller microspores; (3) the subsequent divergence in size and specialization of the two spore types. The model explains haploid dioecy as a consequence of pre-existing mechanisms of sex determination, and endosporic development as a consequence of an increased dependence on spore food reserves for reproduction.