The crystal structure of Ba6R2Ti4O17 (R = Nd and Y) was determined by combined analysis of X-ray and neutron powder diffraction data. Both materials crystallize in hexagonal symmetry with space group P6(3)/mmc, Z = 2. The unit cell parameters at room temperature are a = 5.99283(9) Angstrom and c = 29.9289(8) Angstrom for Nd and a = 5.93055(4) Angstrom and c = 29.5239(3) Angstrom for Y. The structure can be described as stacking of cubic (c) and hexagonal (h) [BaO3] layers as well as ordered, oxygen-deficient, pseudo-cubic (c') [BaO2] layers in the sequence of (c'cchcc)(2) along the c-axis and belongs to the 12-layer hexagonal perovskite-related family. The structural framework exhibits face-sharing TiO6 octahedral layers (Ti2O9), RO6 octahedral layers, and TiO4 tetrahedral layers. The TiO4 subunits form around the c' layers.