The various psychological dimensions of professional identity formation (PIF) are an important aspect of the study course for undergraduate medical students. Anatomical learning environments have been repeatedly shown to play a critical role in forming such an identity; however, relevance of PIF during sonoanatomical training remains underexplored. At the end of their basic anatomy studies, third‐semester medical students took part in a four‐day block course on anatomy and imaging. Anatomical content was revised in small groups using peer teaching and imaging methods, including one hour of hands‐on sonoanatomy sessions each day. On‐site sonoanatomy was identified as an excellent format to support students' transition from the pre‐clinical to clinical phase as medical experts‐to‐be. Students enjoyed practical exercises and the clinical input, which increased their interest in the medical profession and their academic studies. This study further examined the effects of the transition into an online‐only format, necessitated by the current Covid‐19 pandemic. A comparison was made between the quantitative and qualitative evaluation data, and the written results of examinations of several on‐site (n = 1096, mean age = 22.4 years ± 2.18), and online‐only cohorts (n = 230, mean age = 22.6 years ± 2.21). The online‐only transition led to a reduction of all PIF‐related variables measured, losing identity‐related variables, increasing students' stress levels, and reducing their long‐term academic performance. Together, this study demonstrates presence of PIF in undergraduate sonoanatomy teaching, and cautions against the uncritical online‐only substitution of hands‐on learning environments.