OBJECTIVE: To establish a method for the detection of volatile constituents from the leaves and fruits of Piper nigrum. METHODS: HS-SPME-GC-MS was used. The chromatographic conditions: column was HP-5 MS quartz elastic capillaries, carrier gas was high purity helium (99.999%), flow rate was 1.0 mL/min, the inlet temperature was 250 ℃, initial temperature of column was 50 ℃ (temperature programmed), split injection with split ratio of 10 ∶ 1. MS conditions: ionization mode was electron impact ion source, ionization energy was 80 eV, ion source temperature was 230 ℃, quadrupole temperature was 150 ℃, transmission line temperature was 280 ℃, electron multiplier voltage was 1 588 V, mass scanning range was m/z 30-400. The spectra were retrieved using RTLPEST3. L and NIST08. L, and the relative contents of the volatile constituents were determined by area normalization method. RESULTS: There were 28 volatile constituents in the leaves and 15 in the fruits, respectively accounting for 67.13% and 36.85%. The major volatile constituents of leaves were β-caryophyllene (15.72%), limonene (9.39%), 3-carene (9.32%), β-pinene (6.80%), α-terpine(4.98%),etc., the main volatile constituents of fruits were 1,7,7-trimethyl-2-vinylbicyclo[2.2.1]hept-2-ene (10.45%), espatulenol (8.28%), caryophyllene oxide (4.81%), etc. 5 constituents were owned in both. CONCLUSIONS: The study basically clears the main volatile constituents from the leaves and fruits of P. nigrum, and verifies existing obvious differences.