Code-switching has been a frequent feature of literary texts from the beginning of English literary tradition to the present time. The medieval period, in particular, with its complex multilingual situation, has provided a fruitful background for multilingual texts, and will be the focus of the present article. After looking at the linguistic background of the period and some specifics of medieval literature and of historical code-switching, the article discusses the main functions of code-switching in medieval poetry and drama, especially in regard to the different but changing status of the three main languages of literacy: Latin, French and English. This functional-pragmatic approach is complemented by a section on syntactic aspects of medieval literary code-switching, which also contains a brief comparison with modern spoken code-switching and shows some important similarities and differences between the two sets of data.