• This paper designs a depth-of-field 3D code which can be used for product traceability anti-counterfeiting. • Studying the effect of different laser parameters on the depth-of-field unit module. • Research on recognition and information reading of depth of field 3D code. In order to reduce the market in a large number of counterfeit imitation products, product traceability anti-counterfeiting by more and more attention. Therefore, it is imperative to study product traceability and anti-counterfeiting marking technology. However, for products within a limited size, the data capacity of traditional Data Matrix (DM) code is insufficient to meet the storage requirements, and it is easy to clone and copy, which limits the development of laser marking technology. In order to improve the replication difficulty and information storage capacity of the Data Matrix code, the depth-of-field (DOF) 3D code is devised by adding Z-axis depth information to the original Data Matrix code, which can accommodate a larger information storage capacity and improve the reproduction difficulty of DM code, thus meeting the current commercial demand. In this paper, cemented carbide is taken as the research object, and DOF 3D code is marked on its surface by femtosecond laser, and the optimal process parameters are determined. At the same time, the recognition and information reading of DOF 3D code is studied, and the correctness and reliability of its information acquisition are tested. [ABSTRACT FROM AUTHOR]