Purpose Utilizing through-the-thickness pin reinforcement in metal-to-composite joints can significantly increase the joint mechanical properties, enabling the introduction to a whole new field of applications in joining technology. However, with the rise of advanced pin manufacturing techniques – such as additive layer manufacturing, little research has been performed on the pin shape optimization and its behavior. The paper aims to discuss this issue. Design/methodology/approach In this study, a numerical shape optimization algorithm is used to produce optimized pin shapes for several initial pin dimension parameters, having as objective to achieve a more uniform stress distribution along the surface of the pin, enhancing the pin strength and joint integrity. Findings Results showed that pin shape is a crucial factor in the mechanical response of the pin. In Mode I, the presence of an undercut feature on the pin head can increase the ultimate load of the pin by +250 percent, while in Mode II, the base diameter is the dominant feature in the joint ultimate strength. Originality/value With these results, the paper aims to utilize commercial available numerical software to explore optimization capabilities in joints strength. These optimization capabilities show that it could be used for the enhancement of metal-to-composite joints response.