Impulsivity is linked to adverse outcomes, such as substance abuse and risky behaviors. Understanding how anxiety contributes to impulsivity is crucial for intervention. This study explores the potential mediating role of cognitive flexibility in the relationship between anxiety and impulsivity. This study investigates whether cognitive flexibility serves as a mediating factor between anxiety and impulsivity, aiming to elucidate the underlying mechanisms of their association. A convenience sample of 505 participants aged 18-30 without psychiatric or substance abuse disorders was included. Participants completed the General Anxiety Disorder-7, Barratt Impulsiveness Scale-11, and Cognitive Flexibility Inventory. Path analysis was conducted to examine the potential mediating role of cognitive flexibility. The study revealed a significant direct link between anxiety and impulsivity (β = 0.1807, p = 0.001). However, it was found that cognitive flexibility did not mediate this relationship. The indirect effect of anxiety on impulsivity through cognitive flexibility was not statistically significant (β = -0.0163, p = 0.074). These findings suggest that cognitive flexibility, as assessed in this study, does not account for the relationship between anxiety and impulsivity. While this study explored cognitive flexibility as a potential mediator, it did not find evidence to support this role. This implies that other factors may play a more significant part in explaining the link between anxiety and impulsivity. The study highlights the complexity of these psychological constructs and underscores the need for further research to unravel their interplay. It emphasizes the importance of considering nuanced aspects of anxiety, impulsivity, and cognitive flexibility in future investigations. This research contributes to the ongoing discussion surrounding these psychological traits and the factors influencing their relationship.