During the storage period after harvest, the presence of volatile esters is essential for European pear aroma. Nevertheless, the specific molecular process underlying the production of volatile esters in European pear remains elusive. In this research, head space solid phase microextraction and gas chromatography-mass spectrometry were employed to examine the volatile compounds of two varieties of European pear. The results revealed the identification of a collective of 149 volatile compounds, which were categorized into 8 groups: esters (37), alcohols (25), alkanes (24), aldehydes (22), terpenes (15), acids (8), ketones (6) and other categories (12). Notably, there were 79 volatile compounds that coexisted in both varieties, which esters are the primary group of volatile compounds found in both varieties. Through transcriptome analysis, we identified 12 candidate genes associated with ester biosynthesis and established their correlation with firmness, ethylene production, and predominant volatile esters. The results from gene expression analysis revealed significant up-regulation of PcFAD2 and PcLIP2 in both varieties and PcFAD6 exhibits low expression levels. The results indicate that the involvement of these three genes in the synthesis of esters in European pear may have a significant level of importance. This study enhances our understanding of the mechanisms involved in the formation of European pear flavor.