The present study delves into code-switching among young Algerian English as a foreign language Facebook users, aiming to elucidate its functions and motives and thereby contributing to the sociolinguistic discourse on online communities. To achieve this, 917 posts and comments from 42 second-year English-major students aged 19-22 at Batna 2 University were analyzed for code-switching instances. These participants were selected through convenience sampling. Additionally, semi-structured interviews were conducted with 17 randomly selected members of the sample to gain further insights. The findings illuminate code-switching as a strategic tool rather than a random choice, serving various linguistic and social functions such as using habitual expressions, filling lexical gaps, economizing words, clarifying, emphasizing, showing affection, addressing specific audiences, and avoiding taboos. Motivations behind code-switching were diverse, including low English language proficiency, linguistic limitations, facilitation of communication, novelty-seeking, emotional expression, and politeness. Overall, the research underscores code-switching as a purposeful linguistic strategy that transcends norms to fulfill communicative intentions and enhance stylistic expression. These findings emphasize the importance of understanding code-switching motivations in online communities, offering valuable insights into language dynamics in digital environments.