Spectral domain optical coherence tomography (SD-OCT) with extended scan depth makes it possible for quantitative measurement of the entire ocular surface shape. We proposed a novel method for ocular surface shape measurement using a custom-built anterior segment SD-OCT, which will serve on the contact lens fitting. A crosshair alignment system was applied to reduce the misalignment and tilting of the eye. An algorithm was developed to automatically segment the ocular surface. We also described the correction of the image distortion from the segmented dataset induced by the nontelecentric scanning system and tested the accuracy and repeatability. The results showed high accuracy of SD-OCT in measuring a bicurved test surface with a maximum height error of 17.4 μm. The repeatability of in vivo measurement was also good. The standard deviations of the height measurement within a 14-mm wide range were all less than 35 μm. This work demonstrates the feasibility of using extended depth SD-OCT to perform noninvasive evaluation of the ocular surface shape.