Precision laser micromachining plays an important role in the biomedical, electronics, and material processing industries. During laser drilling, precision depth detection with micrometer-level resolution is required, particularly with blind-hole or heterogeneous structures. We present an optical detection system utilizing an optical confocal structure, experimentally confirmed to achieve a >95% accuracy for micron-diameter holes that are tens-of-microns deep. This system can be easily integrated into commercial laser micromachining processes, and can be employed in laser drilling and three-dimensional active-feedback laser printing.