The three dimensional domain structure of barium titanate thin films was determined using a serial sectioning technique. The domain structure varied sharply through the film thickness, being primarily a-oriented near the substrate and increasingly c-oriented away from this interface. The variation in domain structure is explained in terms of a strain gradient due to partial relaxation of epitaxial coherency strains. The refractive index also varied through the film thickness. A simple relationship based on areal fraction of each domain type aptly described the changes in refractive index with domain structure. These results indicate the importance of understanding three-dimensional domain structure and its impact on film properties.