Compared to conventional lenses, gradient index lenses are lighter in weight, smaller in volume, and easy to couple. To facilitate the measurement of a small irregular surface in a limited space, a small optical inspection system is presented, which combines the high axial resolution and absolute position tracking capability of differential confocal microscopy and the compact design of a gradient index lens, and uses the gradient index lens to obtain a small detector 1 mm in diam. The operating principle and construction of the measurement system are detailed, and the design of gradient index lenses is discussed. This differential confocal measurement system features high lateral resolution and depth-discriminated sections. The differential design of the two detectors eliminates both the fluctuation of light source and the electronic noise from probes, and increases the axial resolution as well. With a 1-mm-diam probe an axial resolution of 5 nm is obtained for gauge blocks less than 20 deg. In addition to its application for measurement of a small irregular surface in limited space, the sensor system proposed can be fitted onto a coordinate measuring machine for noncontact measurement of dimensions and surface roughness, and incorporated into a CNC machining center for on-line quality monitoring.