The scientific research is devoted to the mathematical modeling of the optimal topology of stamps with a complex forming surface. Topological optimization is based on the SIMP method by creating a field of pseudo-densities and minimizing the pliability of the structure under the influence of load. When setting the problem, it is proposed to take into account the fatigue strength of polymers, taking into account the restrictions on the stress state. According to the results of the calculation in the ANSYS software package, an optimal redistribution of the stamp material and a reduction in volume due to the removal of elements that have little effect on the rigidity of the structure is obtained. The results of the study can be further applied in the field of hot and cold stamping by creating stamping tools of minimal volume.