In this work, we propose a numerical technique to compensate for errors due to dispersion effects in Fourier domain optical coherence tomography. The proposed technique corrects for errors in depth measurements and resolution loss due to dispersion. The results show that, by using this technique, errors in thickness measurement are reduced from about 5% to less than 0.1% depending on the sample length and the amount of dispersion. Also, an improvement in the resolution from about 50 μm to less than 10 μm is demonstrated.