The structure and conformational composition of 1,3-dichlorobutane and 1,3-dibromobutane have been studied by gas-phase electron diffraction (ED) at 28 and 23 degrees C, respectively. Results from ab initio molecular orbital calculations (HF/6-31G* and HF/6-31G*/Binning, respectively) have been used as constraints in the ED analysis. These molecules may in principle exist as a mixture of nine different conformers, five of these were included in the theoretical model for the electron diffraction investigation. For both compounds the investigation indicated that the G+G+ conformer dominated the conformational composition in the gasphase (54 +/- 20% and 60 +/- 22%, for 1,3-dichlorobutane and 1,3-dibromobutane, respectively). The distributions among the other conformers are more uncertain, because some of them give nearly equal distance distributions. The least-squares refinements gave the following results: G-A (17 +/- 24% and 36 +/- 22%, for 1,3-dichlorobutane and 1,3-dibromobutane, respectively), AG+ (14 +/- 25% and <1%, respectively), and AA (10 +/- 22% and 4 +/- 9%, respectively). The first and the second symbol, respectively, refer to torsion about the C-1-C-2 and C-2-C-3 bonds. The symbols refer to anti (A) with a torsion angle of 180 degrees and gauche (G+ and G-) with torsion angles of +60 degrees and -60 degrees, respectively. The results for the principal distances (r(g)) and angles angle(alpha) from the combined ED/ab initio study for the G+G+ conformer of 1,3-dichlorobutane with the estimated 2 sigma uncertainties are r(C-1-C-2) = 1.524(3) Angstrom, r(C-2-C-3) = 1.527(3) Angstrom, r(C-3-C-4) = 1.530(3) Angstrom, r(C-1-Cl) = 1.799(3) Angstrom, r(C-3-Cl) = 1.810(3) Angstrom, (r(C-H)) = 1.083(11) Angstrom, angle C1C2C3 = 114.5(7)degrees angle C1C2C3 = 114.5(7)degrees, angle C2C3C4 = 111.0(7)degrees, angle C2C1Cl = 112.1(6)degrees, angle C2C3Cl = 109.9(6)degrees, (angle CCH) = 111.9(20)degrees. The results for the G+G+ conformer of 1,3-dibromobutane are r(C-1-C-2) = 1.518(6) Angstrom, r(C-2-C-3) = 1.521(6) Angstrom, r(C-3-C-4) = 1.526(6) Angstrom, r(C-1-Br) = 1.963(6) Angstrom, r(C-3-Br) = 1.974(6) Angstrom, [r(C-H)] = 1.082(11) Angstrom, angle C1C2C3 = 115.3(16)degrees, angle C2C3C4 = 111.6(16)degrees, angle C2B1Br = 112.2(9)degrees, angle C2C3Br = 109.8(9)degrees, (angle CCH) = 111.5(51)degrees. Only average values for r(C-C), r(C-X), r(C-H), angle CCC, angle CCX, and angle CCH were determined in the least-squares refinements; the differences between the values for these parameters in the same conformer and between different conformers were kept constant at the values obtained from our ab initio calculations.