The homodimers and heterodimers of four carboxylic acids RCOOH and four amides RCONH2, where R = H, methyl, phenyl, p-ethylphenylene have been calculated via DFT(M06-2X), MP2, and CCSD(T) methods in conjunction with the 6-31G(d,p), 6-311+G(d,p), aug-cc-pVTZ, and aug-cc-pVQZ basis sets to find out how the substituent R influences their dimerization energy (ΔE) and their hydrogen bond length. The calculated ΔE values range from 14 to 17 kcal/mol for the different dimers in the gas phase, with the ordering carboxylic homodimers ≥ amide-carboxylic dimers > amide homodimers. The M06-2X/6-311+G(d,p) geometries and ΔE values are in very good agreement with the corresponding MP2/aug-cc-pVQZ and CCSD(T)/aug-cc-pVTZ values. Coencapsulation of the dimers was studied to examine its effect on the calculated bond lengths and strength of the hydrogen bonds at the M06-2X/6-31G(d,p) level of theory. The experimental and calculated % distributions of the encapsulated dimers, taking into account statistical factors are in good agreement. © 2012 Wiley Periodicals, Inc.