Computational thinking (CT) is a crucial skill for addressing the challenges of the 21st century. This study sought to investigate the impact of the Discovery Learning model on students’ CT abilities, examining the influence of learning models, self-regulated learning (SRL) levels, and their interplay. The research employed a quantitative approach employing a quasi-experimental design involving two Grade 7 classes: an experimental group (n = 26) receiving instruction through the Discovery Learning model and a control group (n = 24) receiving conventional instruction. Instruments included an essay test assessing CT and a Likert-scale questionnaire evaluating SRL. Data were analyzed employing descriptive statistics, the Mann-Whitney test, and the Kruskal-Wallis test. The findings indicated that the average CT score in the experimental class (67.60) was superior to that in the control class (62.82). However, the Mann-Whitney test revealed that this disparity was not statistically significant (p = 0.151 > 0.05). Although no significant difference was observed when comparing the two learning models collectively, the Kruskal-Wallis test demonstrated a substantial effect of SRL on CT (p = 0.000). Furthermore, a significant interaction was identified between the learning model and the SRL level (p = 0.000). Notably, students with high SRL achieved the highest CT performance within the Discovery Learning group. These findings underscore the efficacy of combining the Discovery Learning model with high levels of student self-directed learning in enhancing computational thinking abilities. This evidence suggests that integrating teaching models with student learning autonomy yields more favorable outcomes.