A new two-dimensional bar-code detection system is proposed in which a masked collimator is employed to improve the quality of the laser beam and extend the depth of focus. The proposed system provides high detection resolution over a longer detection range while remaining compact and inexpensive. Three laser-diode units with collimator and mask were designed and tested, and the devices were confirmed to produce light beams narrower than 268 μm in width for a minimum detection range of 6 cm. The best performance was obtained combining masks with 2.5 and 3 mm hole diameters, providing a practically usable detection range of 12.5 cm for 0.25-mm 3-line bar codes. The maximum detection range of the proposed system is more than 3.1 times longer than conventional collimator systems, and has potential application in high-speed, high-resolution bar-code systems.