In this study, a nanosecond laser marking machine was employed to nitride the surface of a Ti-6Al-4V alloy in a nitrogen-rich environment. Consequently, a crack-free and uniform nitriding layer was successfully achieved. Furthermore, a 2D code with enhanced contrast was imprinted on the sample, and subsequently, a durability test was conducted to assess its performance. The impacts of laser power (ranging from 9 to 11 W), scanning speed (17 to 23 mm/s), and line spacing (20 to 40 µm) on the surface morphology, thickness, and color alteration of the nitride layer were systematically investigated through experimental analysis. Utilizing a spectrophotometer, scanning electron microscope, optical microscope, energy dispersive spectroscopy instrument, and other advanced equipment, we further delved into the underlying mechanism of surface color change during laser gas nitriding of a Ti-6Al-4V alloy. Results indicate that an increase in laser power and a decrease in line spacing and scanning speed lead to the generation of higher energy densities on the material surface, intensifying ablation and causing the formation of more molten material. Consequently, this results in the development of more complex surface structures, thicker nitride layers, and lower reflectance. The surface microstructure of the nitride layer exhibits similarities and variations, and the thickness of the nitride layer differs, leading to distinct light absorption and reflection properties on its surface. Consequently, the nitride-layer surfaces prepared under varying laser parameters exhibit diverse contrasts.