Hairpin DNA (hpDNA) loops were used for the first time as molecular binding elements in gas analysis. The hpDNA loops sequences of unpaired bases were studied in-silico to evaluate the binding versus four chemical classes (alcohols, aldehydes, esters and ketones) of volatile organic compounds (VOCs). The virtual binding score trend was correlated to the oligonucleotide size and increased of about 25% from tetramer to hexamer. Two tetramer and pentamer and three hexamer loops were selected to test the recognition ability of the DNA motif. The selection was carried out trying to maximize differences among chemical classes in order to evaluate the ability of the sensors to work as an array. All oligonucleotides showed similar trends with best binding scores for alcohols followed by esters, aldehydes and ketones. The seven ssDNA loops (CCAG, TTCT, CCCGA, TAAGT, ATAATC, CATGTC and CTGCAA) were then extended with the same double helix stem of four base pair DNA (GAAG to 5' end and CTTC to 3' end) and covalently bound to gold nanoparticles (AuNPs) using a thiol spacer attached to 5' end of the hpDNA. HpDNA-AuNPs were deposited onto 20 MHz quartz crystal microbalances (QCMs) to form the gas piezoelectric sensors. An estimation of relative binding affinities was obtained using different amounts of eight VOCs (ethanol, 3-methylbutan-1-ol, 1-pentanol, octanal, nonanal, ethyl acetate, ethyl octanoate, and butane-2,3-dione) representative of the four chemical classes. In agreement with the predicted simulation, hexamer DNA loops improved by two orders of magnitude the binding affinity highlighting the key role of the hpDNA loop size. Using the sensors as an array a clear discrimination of VOCs on the basis of molecular weight and functional groups was achieved, analyzing the experimental with principal components analysis (PCA) demonstrating that HpDNA is a promising molecular binding element for analysis of VOCs.