This study investigates the types of code-switching as categorized by Poplack and analyzes their functions in the context of online language teaching. Employing a qualitative approach, the study utilized classroom observations and teacher interviews to investigate the types and functions of code-switching. Five recorded online English lessons were analyzed to identify patterns of code-switching, and a semi-structured interview with the teacher provided insights into the rationale behind its use. Findings revealed that intra-sentential code-switching was the most frequently used, followed by inter-sentential and tag-switching. In addition to these patterns, the study also identifies their main functions. The primary functions of code-switching include facilitating curriculum access, managing the classroom, and fostering interpersonal connection. While these findings align with Alghasab’s framework, some instances fall outside these categories suggesting the presence of additional functions that require further investigation. These findings indicate that code-switching serves a broader range of pedagogical purposes in virtual classrooms, highlighting the need for further exploration.