In optical coherence tomography (OCT) systems, axial resolution improves with increasing light source bandwidth. However, dispersion imbalance between the sample and reference arms can degrade axial resolution and signal to noise ratio, a significant issue for ultrahigh-resolution OCT systems. In this work, we demonstrate a novel technique for estimating and compensating for OCT system dispersion, that is unique from previously reported methods in that it compensates all orders of system dispersion. Dispersion phase was estimated by first measuring the phase from of the spectrogram at two different, reference-sample arm optical path length differences (OPLD) around zero OPLD and then subtracting the two phase values to obtain the dispersion phase. This phase can be used to compensate the dispersion term in the spectrum by multiplying the interference pattern with where k is the wave-vector. This method was tested to compensate the dispersion caused by a 3-mm fused silica window in one arm of an ultrahigh spectral domain OCT system in our laboratory that utilizes a light source with a 850 nm center wavelength, 300 nm bandwidth. Using our dispersion compensation technique, the experimentally measured axial resolution of the system was fully recovered to match the theoretical resolution, improving from 10.6µm to 1.85µm in air. These results suggest that this dispersion compensation method may be useful to avoid axial resolution degradation due to dispersion effects in ultrahigh-resolution OCT systems that employ extremely broad band light sources.