Electronic and spatial structure of some H-bonded complexes ((HCOOH)n (n=1–4), formic, acrylic acids and their complexes with water and dimethylsulfoxide) were studied by ab initio methods using MP2/RHF//6-31G∗, RHF/6-31G∗ basis sets, and also by using density functional theory (DFT) within the B3LYP approximation. The possibility of formation of chain and cyclic complexes of formic and acrylic acids with dimethylsulfoxide is shown. In a cyclic complex two hydrogen bonds are formed. One is as usually with the O–H bond (SO⋯H–O), the other is between the acid carbonyl group and one hydrogen atom of DMSO methyl groups (C–H⋯OC). The calculations of nuclear magnetic shielding were carried out within a framework of the coupled Hartree–Fock method using gauge invariant atomic orbitals. Analysis of the results for various basis sets and comparison of the calculated and experimentally obtained chemical shifts show that the calculations predict a significant downfield shift for 1H and 13C nuclei for H-bonded systems. The results of calculations of 17O magnetic shielding constants strongly depend on the used basis set and theoretical approach.