Terahertz (THz) imaging and optical coherence tomography (OCT) provide similar information over the same scales. Here, we present an iterative algorithm that combines the information from OCT and THz within an object to determine both the depth of the reflecting layers at different locations. Also, we can extract unknown refractive index of the object for both the OCT wavelengths and THz frequencies. We validate this algorithm using a phantom test object with embedded layers and show that the depths and refractive index values obtained from the algorithm agreed with the measured values to within 3%. We further demonstrate for the first time that OCT and THz images can be co-registered and aligned using unsupervised image registration. Hence, we show that a combined OCT/THz system can provide unique information beyond the capability of the separate modalities alone, with possible applications in the medical and industrial sectors.