The molecular structure of 2,5-dihydroxyterephthalaldehyde has been determined from a joint electron diffraction/ab initio investigation, and the molecular structure of 4,6-dihydroxyisophthalaldehyde has been obtained from ab initio calculations at the MP2/6-31G* level. There is considerable intramolecular hydrogen bonding in these structures manifested by the O···H and O···O distances as well as by the structural changes in the rest of the molecule. These changes are consistent with the notion of resonance-assisted hydrogen bonding. The hydrogen bonding is somewhat stronger in 4,6-dihydroxyisophthalaldehyde than in 2,5-dihydroxyterephthalaldehyde, and this difference may be linked to the difference in the mutual positioning of the interacting formyl and hydroxy groups in these molecules.