A study was investigated to determine and compare the key aroma components in raw and roasted walnut (Juglans regia L.). The effective aromatic compounds in raw and roasted walnut were separated by solvent-assisted flavor evaporation (SAFE), and a total of 160 volatile compounds were identified by gas chromatography-mass spectrometry (GC-MS), which constituted the distinctive flavor of raw and roasted walnut. The key aroma components were further revealed by aroma extract dilution analysis (AEDA), and 29 aroma compounds were identified as highly related to the characteristic aroma of walnut. Finally, the selected aroma compounds were quantitated and odor activity values (OAVs) were calculated. A total of 10 aroma-active compounds of OAVs ≥ 1 were identified in raw walnut, among which (E)-2-nonenal showed the highest OAV, and octanal, hexanal, and nonanal were also contributive to the flavor of raw walnut. In roasted walnut, 20 aroma-active compounds (OAVs ≥ 1) were obtained, and (E,E)-2,4-decadienal, 1-octen-3-ol and pyrazines were the characteristic flavor sources of roasted walnut. In general, the roasting process had a significant effect on the flavor characteristics of walnut; it can increase complexities to the walnut volatiles, and provide a more desirable roast and nutty flavor.