AbstractThe participatory view of learning emphasises students' identity construction. However, identity research in the context of programming education to cultivate students' computational thinking is scarce. In this study, an instrument of computational identity with components of engagement, imagination and affiliation, was developed and validated. Convenience sampling was used to select 1066 senior primary school students studying programming to respond to the instrument, and to a programming empowerment instrument developed previously with components of meaningfulness, self‐efficacy and impact. The two instruments' factor structure was confirmed to have acceptable discriminant validity and support gender invariance. There was a positive relationship between programming empowerment and computational identity. Specifically, students' perceived meaningfulness and self‐efficacy of programming related to all aspects of computational identity. The perceived impact of programming is related only to the imaginative aspect of computational identity. The establishment of the instrument enables researchers to investigate further factors related to students' computational identity development. The results also indicate that the programming curriculum should be carefully designed so that students can realise the meaning of the activities and foster their programming self‐efficacy. This, in turn, is critical to enable these primary school students to participate in and become a member of the digital community. Practitioner notesWhat is already known about this topic Cultivating students' computational thinking (CT) has become an educational goal in various countries around the world. It is necessary to develop appropriate tools to assess students' CT development. Founded on a participatory view of learning, identity has been employed in different subject areas to assess students' development, but identity research in CT is scarce. What this paper adds An instrument of computational identity with components of engagement, imagination and affiliation is developed and validated with a sample of senior primary students. This study shows the importance of empowerment in developing primary students' computational identity. Students' perceived meaningfulness of programming and self‐efficacy relate to all aspects of identity, but the impact of programming only relates to the imaginative aspect of identity. Implications for practice and/or policy The curriculum for CT should be designed carefully to foster the development of students' computational identity. The curriculum should allow students to see the meaning of programming activities and how young people can make an impact by means of CT. The programming tasks should be designed at an optimal level of difficulty so that students' self‐efficacy can be fostered.