© 2014 AIP Publishing LLC. The atomic structure and the electron transfer properties of hydrogen bonds formed between two carboxylated alkanethiol molecules connected to gold electrodes are investigated by employing the non-equilibrium Green's function formalism combined with density functional theory. Three types of molecular junctions are constructed, in which one carboxyl alkanethiol molecule contains two methylene, -CH2, groups and the other one is composed of one, two, or three -CH2 groups. Our calculations show that, similarly to the cases of isolated carboxylic acid dimers, in these molecular junctions the two carboxyl, -COOH, groups form two H-bonds resulting in a cyclic structure. When self-interaction corrections are explicitly considered, the calculated transmission coefficients of these three H-bonded molecular junctions at the Fermi level are in good agreement with the experimental values. The analysis of the projected density of states confirms that the covalent Au-S bonds localized at the molecule-electrode interfaces and the electronic coupling between -COOH and S dominate the low-bias junction conductance. Following the increase of the number of the -CH2 groups, the coupling between -COOH and S decreases deeply. As a result, the junction conductance decays rapidly as the length of the H-bonded molecules increases. These findings not only provide an explanation to the observed distance dependence of the electron transfer properties of H-bonds, but also help the design of molecular devices constructed through H-bonds.