Recent studies of animal metabolism have revealed large numbers of novel metabolites that are involved in all aspects of organismal biology, but it is unclear to what extent metabolomes differ between sexes. Here, using untargeted comparative metabolomics for the analysis of wildtype animals and sex determination mutants, we show that C. elegans hermaphrodites and males exhibit pervasive metabolomic differences. Several hundred small molecules are produced exclusively or in much larger amounts in one sex, including a host of previously unreported metabolites that incorporate building blocks from nucleoside, carbohydrate, lipid, and amino acid metabolism. A subset of male-enriched metabolites is specifically associated with the presence of a male germline, whereas enrichment of other compounds requires a male soma. Further, we show that one of the male germline-dependent metabolites, an unusual dipeptide incorporating N,N-dimethyltryptophan, increases food consumption, reduces lifespan, and accelerates the last stage of larval development in hermaphrodites. Our results serve as a foundation for mechanistic studies of how the genetic sex of soma and germline shape the C. elegans metabolome and provide a blueprint for the discovery of sex-dependent metabolites in other animals.