This paper reports on a confocal displacement sensor with varifocal lens used to measure the thickness of transparent materials. The focal length of the varifocal lens is adjusted by varying the current. Laser light passing through a transparent target lying within the range of the focal length crosses two interfaces; i.e., first from air to glass and then from glass to air. The signals associated with the interface were of higher intensity than that measure at other points along the z axis. A power meter is used to measure the power and LabVIEW is used to record a power-current graph. The current gap between the two peaks can be translated into values of displacement, indicating the thickness of the material.