We have investigated the extraordinary optical transmission of terahertz waves through an array of nanogaps with varying dimensions and periodicities, and used this platform to demonstrate terahertz sensing of a thin film of single-walled carbon nanotubes. We have used atomic layer lithography to fabricate periodic arrays of nanogap loops that have a gap size of 2 nm and a loop length of 100 mu m (aspect ratio of 50 000). These sub-mm-scale loops of nanogaps can sustain terahertz electromagnetic resonances along the contour. We have characterized the transmission of terahertz waves through the nanogap arrays and investigated the influence of inter-gap electromagnetic coupling as the array periodicity shrinks from 100 mm to 4 mm. While the gaps occupy only 0.1% of the surface area, we have measured an amplitude (vertical bar E vertical bar) transmittance of over 50% due to the strong and broadband field enhancement inside the nanogaps. The absolute transmission through the 2 nm gaps along the rectangular loops can be boosted up to 25%, while it is only 1% for annular gaps with the same perimeter. Furthermore, the extremely tight field confinement and strong field enhancement near the 2 nm gap lead to 43% extinction of THz waves in a 10 nm-thick film of single-walled carbon nanotubes over the gaps. On the other hand, THz extinction by the same nanotube film on a bare glass substrate is only 2%. These nanogaps pave the way toward developing sensitive terahertz detectors for biological and chemical targets.