The aim of this work is to better understand the interaction between the confined dihydrogen molecule and armchair (2,2), (3,3) (4,4), (5,5), and (6,6) single-walled carbon nanotubes (SWNT) using Restricted Hartree–Fock (RHF) and Density Functional Theory (DFT) methods using B3LYP and CAM-B3LYP functionals. Depending on the calculation method and its orientation inside the nanotube, H2 binds differently. We found that HH bond length increases when H2 is trapped in CNT (2,2) and decreases for CNT (3,3) and (4,4). The characteristics of confined H2 in (5,5) and (6,6) nanotubes are similar to H2 in a free state. © 2013 Wiley Periodicals, Inc.