The 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