Trichosanthes anguina L. (family Cucurbitaceae) is a monoecious and diclinous plant that can be consumed as a vegetable and has anti-inflammatory and antioxidant effects. The chemical composition and content of volatile compounds in female and male buds of T. anguina were explored by headspace solid-phase microextraction-gas chromatography-mass spectrometry (HS-SPME-GC-MS) technology combined with multivariate statistical analysis. The results showed that the content of the volatile compounds was different between female and male buds. 2,2,6-trimethyl-6-vinyltetrahydro-2H-pyran-3-ol and 2,2,6-trimethyl-6-vinyldihydro-2H-pyran-3(4H)-one were the main volatile compounds in both female and male buds. Based on the multivariate statistical analysis of orthogonal projections to latent structures discriminant analysis (OPLS-DA) and t-test, the content of seven compounds was significantly different between female and male buds. The content of three compounds in male buds was higher than that in female, i.e., (E)-4,8-dimethyl-1,3,7-nonatriene, 1,5,9,9-tetramethyl-1,4,7-cycloundecatriene, and (E)-caryophyllene. Conversely, the content of (Z)-4-hexen-1-ol, (Z)-3-hexenyl benzoate, (Z)-3-hexenyl salicylate, and 2-hexen-1-ol in female buds was higher than that in male buds. This is the first report on the difference in the volatile compounds between female and male buds of T. anguina, which enriches the basic research on the monoecious and diclinous plant and provides a reference for the study of plant sex differentiation.