Introduction An ongoing trend on a global scale is the integration of computer science and programming in K-12 education. The integration has been motivated by the needs of the present and future labor market but also by the assumption that skills related to computer science and programming are valuable for citizens to navigate an increasingly digitalized society. Computational thinking (CT) is a concept that aims to define and summarize skills associated with programming and computer science and has received wide recognition within research and education. But how do the teachers perceive this concept, and how do they relate it to their own teaching and learning activities? This study aims to investigate and discuss teachers' perceptions of CT in grades 7–12 mathematics and technology. Methods Data have been collected from essay assignments in three instances of a professional development course on fundamental programming for grades 7–12 teachers in mathematics and technology. In the essays, the teachers reflect on CT in relation to mathematics and technology and teaching and learning activities in these subjects. With a theoretical framework for CT, the collected data have been analyzed with a directed content analysis approach to identify categories of interests for CT in relation to grades 7–12 mathematics and technology. Results The results of the study show that the teachers perceive both opportunities and challenges in applying the CT concept in their teaching and learning activities. For example, it can strengthen the subjects through new practices and reinforce old practices, but it could be too complex and perceived as difficult by some students. Furthermore, many of the teachers perceive CT not only to be relevant for mathematics and technology but also for learning in general. Discussion The conclusion of the study is that CT has the potential to enhance teaching and learning activities in mathematics, technology, and other STEM subjects. If this should be successful, CT must not be involved too abstractly or too superficially. This study contributes to the discussion on CT in K-12 education, adding the teachers' perspective. The findings of this study can be used by teachers and other stakeholders in the design of classroom activities that apply the CT concept.