Here we report a new nanogap formation manner at edges of a palladium (Pd) thin film on highly patterned arrays of an elastomeric PDMS substrate fabricated nanoimprint lithography (NIL) by absorption/desorption cycles of H2 for use in the detection of hydrogen (H2) gas. A 10-nm-thick Pd layer was deposited on the patterned PDMS substrate using an ultra-high vacuum DC magnetron sputtering system. The Pd nanogaps (∼100nm (W)) formed on the edges of the grating structure by expansion and contraction of the film through a few cycles of H2 absorption and desorption. Such nanogaps are crucial to the performance of the sensors. The H2 sensors were found to exhibit a fast response time (∼1s), low detection limit (0.1%), wide linear range (0.1–2%), and an ON–OFF switching operation in air. These properties are attributed to the synergistic combination of nanogap break junction control in Pd and the patterned elastomeric substrate.